Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Created September 3, 2015 06:20
Show Gist options
  • Save aaronthorp/332a5b641765ed1a2676 to your computer and use it in GitHub Desktop.
Save aaronthorp/332a5b641765ed1a2676 to your computer and use it in GitHub Desktop.
server {
listen 80 default;
# server_name _;
root /app;
index index.php index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then trigger 404
try_files $uri $uri/ =404;
}
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass php;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment