Skip to content

Instantly share code, notes, and snippets.

@gigablah
Created May 11, 2015 10:19
Show Gist options
  • Select an option

  • Save gigablah/49a6f5e90cf972ee90c8 to your computer and use it in GitHub Desktop.

Select an option

Save gigablah/49a6f5e90cf972ee90c8 to your computer and use it in GitHub Desktop.
nginx config for php-fpm socket
server {
listen 80;
server_name local.kuanyen.net;
gzip on;
gzip_min_length 1000;
location / {
root /opt/www;
index index.php;
try_files $uri /index.php$is_args$args;
}
location = /favicon.ico {
try_files /favicon.ico =204;
}
location ~ ^/(css|img|js)/ {
alias /opt/www;
try_files $uri =404;
access_log off;
log_not_found off;
}
location ~ \.php$ {
root /opt/www;
try_files $uri =404;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
upstream backend {
server unix:/var/run/www.sock;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment