Last active
August 29, 2015 14:23
-
-
Save johnpeele/7176814d8949f92bc98a to your computer and use it in GitHub Desktop.
Statamic Nginx Conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
root /usr/share/nginx/html/livevictorious.com/html; | |
index index.php index.html index.htm; | |
# Make site accessible from http://localhost/ | |
#server_name localhost; | |
server_name livevictorious.com www.livevictorious.com; | |
# Increase file upload size for Messages MP3 | |
client_max_body_size 8M; | |
# Cache static files for as long as possible | |
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { | |
try_files $uri =404; | |
expires max; | |
access_log off; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
# Deny access to configuration files | |
location ~* ^/_config { | |
deny all; | |
return 404; | |
} | |
location ~ /(_app|_config|_content|/layouts/) { | |
deny all; | |
return 404; | |
} | |
location ~ /.(yml|yaml|html) { | |
deny all; | |
} | |
# Return a static file, if it exists, or pass to front controller | |
location / { | |
rewrite ^/admin.php.*$ /admin.php; | |
try_files $uri $uri/ /index.php$args; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment