Created
November 30, 2013 02:53
-
-
Save coolicer/7714806 to your computer and use it in GitHub Desktop.
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 8080 default_server; | |
| server_name 127.0.0.1; | |
| root /home/www/php/; | |
| index index.html index.htm index.php; | |
| location / { | |
| if (!-e $request_filename) { | |
| rewrite ^(.*)$ /index.php?s=$1 last; | |
| break; | |
| } | |
| } | |
| location ~ \.php$ { | |
| try_files $uri =404; | |
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| include /etc/nginx/fastcgi_params; | |
| } | |
| } |
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 8080; | |
| server_name www.demo.com; | |
| root /home/www/php/www.demo.com; | |
| index index.php index.html index.htm; | |
| if (!-e $request_filename) { | |
| rewrite ^/(.*)$ /index.php/$1 last; | |
| break; | |
| } | |
| location ~ \.php | |
| { | |
| #响应请求处理入口,使用php-fpm进行管理 | |
| fastcgi_pass unix:/var/run/php5-fpm.sock; | |
| fastcgi_index index.php; | |
| fastcgi_split_path_info ^(.+\.php)(.*)$; | |
| fastcgi_param PATH_INFO $fastcgi_path_info; | |
| fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| location ~ .*\.(gif|jgp|jpeg|png|bmp|swf)$ | |
| { | |
| expires 30d; | |
| } | |
| location ~ .*\.(js|css)?$ | |
| { | |
| expires 1h; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment