Created
May 11, 2015 10:19
-
-
Save gigablah/49a6f5e90cf972ee90c8 to your computer and use it in GitHub Desktop.
nginx config for php-fpm socket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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