Skip to content

Instantly share code, notes, and snippets.

@peterhallen
Created November 11, 2015 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterhallen/4ea8b26834f534b84b4f to your computer and use it in GitHub Desktop.
Save peterhallen/4ea8b26834f534b84b4f to your computer and use it in GitHub Desktop.
Nginx default
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www;
index index.html index.php;
# Make site accessible from http://localhost/
server_name localhost;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
}
@peterhallen
Copy link
Author

default nginx site-container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment