系统相关
首页 > 系统相关> > nginx出错:rewrite or internal redirection cycle

nginx出错:rewrite or internal redirection cycle

作者:互联网

原配置:location / {

        rewrite ^/(.*).html$ /$1.html?mode=test last;
        error_page 404 = @nodejs;
}



修改后:

location / {
root /path/to/files;
index index.html;
#try_files $uri /index.html;
if ($query_string !~ mode=test) {
rewrite ^/(.*)\.html$ /$1.html?mode=test redirect;
}
}

标签:index,nginx,rewrite,redirection,html,mode,test,location
来源: https://www.cnblogs.com/walkersss/p/14066467.html