Skip to content

Instantly share code, notes, and snippets.

@JingwenTian
Created January 20, 2014 06:48
Show Gist options
  • Save JingwenTian/8516025 to your computer and use it in GitHub Desktop.
Save JingwenTian/8516025 to your computer and use it in GitHub Desktop.
YAF 在Nginx环境下的Rewrite规则
#Yaf手册提供的Nginx的Rewrite (nginx.conf)
#vi /usr/local/nginx/conf/nginx.conf
server {
listen ****;
server_name domain.com;
root document_root;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php/$1 last;
}
}
#错误的地方在:
rewrite ^/(.*) /index.php/$1 last;
正确的写法为:
rewrite ^/(.*) /index.php?$1 last;
#修改完后,重启nginx: /etc/init.d/nginx restart
@Yi-Lyu
Copy link

Yi-Lyu commented Jul 5, 2017

同样遇到了。感谢。已解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment