【发布时间】:2016-04-28 18:07:06
【问题描述】:
我对这个完全感到困惑。它可能很愚蠢,一天后我很想念它!无论如何,我在网站的 nginx 配置中设置了这个重写规则:
location / {
root /srv/www/site.co.uk/www;
index index.html index.htm index.php;
rewrite ^/(.*)/index.html$ http://site.co.uk/$1/ permanent;
rewrite ^/index.html$ http://site.co.uk/ permanent;
}
当我去:
..然后它正确发送到:
如果我将这 2 个重写规则注释掉,重启 nginx,然后重试...页面加载正常!
谁能看出我哪里出错了?也许我只是瞎了眼!
【问题讨论】:
-
不清楚您遇到的问题是什么?你什么时候看到无限循环?
标签: nginx url-rewriting