Created
August 23, 2016 17:04
-
-
Save jackmcdade/a578a29f8acd80d762629e56a22d0dbc to your computer and use it in GitHub Desktop.
This file contains 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; | |
server_name example.com; | |
root /var/www/example.com/public/; | |
ssl_protocols TLSv1.2; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location = / { | |
try_files /static/index.html /index.php?$query_string; | |
} | |
location / { | |
try_files $uri $uri/ /static/$uri /static/$uri/index.html /static/ $uri /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log off; | |
error_log /var/log/nginx/example.com-error.log error; | |
error_page 404 /index.php; | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tinkering with this. Thanks! Do you know if it's possible to only do these static
try_files
rules if the$request_method
isGET
?