Skip to content

Instantly share code, notes, and snippets.

@kyl191
Created April 25, 2015 12:49
Show Gist options
  • Save kyl191/ac8a77ddc0791fc28c95 to your computer and use it in GitHub Desktop.
Save kyl191/ac8a77ddc0791fc28c95 to your computer and use it in GitHub Desktop.
nginx/php
server {
listen 80;
listen [::]:80;
server_name {{item.key}};
root /var/www/{{item.key}};
index index.html index.htm index.php;
access_log /var/log/nginx/{{item.key}}/access.log;
error_log /var/log/nginx/{{item.key}}/error.log;
server_name_in_redirect off;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
# Security - don't continue if the PHP script doesn't exist
# https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-and-nginx-dont-trust-the-tutorials-check-your-configuration/
# alt?:
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_intercept_errors off;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment