Last active
August 29, 2015 14:11
-
-
Save dingyaguang117/77098e42f9614649f034 to your computer and use it in GitHub Desktop.
This file contains 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
# 把形如 /article/ 变成 /article/index.php | |
location ~ ^/article[^.]*/$ | |
{ | |
rewrite ^(.*)$ $1index.php last; | |
} | |
# 之所以没有用$fastcgi_script_name是因为,$fastcgi_script_name会带上/article前缀,导致404,所以我自己获取了脚本的路径 | |
# 应该有更正确的方式去掉/article? | |
location ~ ^/article/(.*)$ { | |
alias /usr/local/nginx-1.6.2/html/wordpress/; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
set $fastcgi_script_name_new $1; | |
fastcgi_param SCRIPT_FILENAME /usr/local/nginx-1.6.2/html/wordpress/$fastcgi_script_name_new; | |
include fastcgi_params; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment