我将url从/index.php?q=account&page=delete&pid=123重写为/account/delete/123时遇到了问题
下面是我的nginx配置
location / {
rewrite ^/account/(undelete|delete|hide|unhide)/([0-9]+)/?$ /index.php?q=account&page=$1&pid=$2 last;
}我的nginx无法启动此配置,并且没有记录任何错误,但是我尝试了nginx -t命令,它显示测试成功
发布于 2014-08-01 11:09:44
我不认为这是nginx重写的好用法。这看起来更像是一个try_files案例。就像这样
location ~ ^/account/(undelete|delete|hide|unhide)/([0-9]+)/?$ { try_files $uri $uri/ /index.php?q=account&page=$1&pid=$2 ; }
不过,它可能需要一些额外的微调。
https://stackoverflow.com/questions/25072121
复制相似问题