Skip to content

Instantly share code, notes, and snippets.

@pangpond
Created January 30, 2017 09:32
Show Gist options
  • Save pangpond/72bad2921fe8aec8603e55b8141bc510 to your computer and use it in GitHub Desktop.
Save pangpond/72bad2921fe8aec8603e55b8141bc510 to your computer and use it in GitHub Desktop.
server {
charset utf-8;
client_max_body_size 128M;
listen 80;
server_name frontend;
root /var/www/html;
index index.php;
access_log /var/log/nginx/frontend-access.log;
error_log /var/log/nginx/frontend-error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass phpfpm:9000;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment