Skip to content

Instantly share code, notes, and snippets.

@julienbourdeau
Created August 11, 2014 05:31
Show Gist options
  • Select an option

  • Save julienbourdeau/d7353af678a1b389f3a0 to your computer and use it in GitHub Desktop.

Select an option

Save julienbourdeau/d7353af678a1b389f3a0 to your computer and use it in GitHub Desktop.
Nginx Server Configuration - Default
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /home/_USER_/www/_DOMAIN_;
index index.html index.htm index.php;
server_name _DOMAIN_;
location / {
try_files $uri $uri/ /index.html;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/_USER_/www;
}
access_log /var/log/nginx/_USER_.access.log;
error_log /var/log/nginx/_USER_.error.log;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm._USER_.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