Created
November 2, 2013 06:15
-
-
Save andrezrv/7276130 to your computer and use it in GitHub Desktop.
Nginx common configuration for non-WordPress sites.
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; | |
# 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