Skip to content

Instantly share code, notes, and snippets.

@andrezrv
Created November 2, 2013 06:15
Show Gist options
  • Save andrezrv/7276130 to your computer and use it in GitHub Desktop.
Save andrezrv/7276130 to your computer and use it in GitHub Desktop.
Nginx common configuration for non-WordPress sites.
#server {
# listen 80;
# root /srv/www/mysite;
index index.php index.html index.htm;
# server_name www.mysite.com;
location / {
try_files $uri $uri/ /index.html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SERVER_PORT 80; # Avoids PHP from sending port in headers.
}
location ~ /\.ht {
deny all;
}
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment