Nginx位置正则表达式块陷入无限循环

时间:2019-07-12 17:22:45

标签: regex nginx

我有这个Nginx定位块。

location ~* ^/featured/([^\/]+)/amp/?$ {
    return 301 https://example.com/prefix/featured/$1/amp/;
}

Regex在我的测试https://regex101.com/r/sivKMX/1中起作用

但是,我最终遇到了重定向循环和这样的URL:

https://example.com/featured/diy/amp/prefix/featured/diy/amp/prefix/featured/diy/amp/prefix/featured/diy/amp/prefix/featured/diy/amp/prefix/featured/diy/amp/

0 个答案:

没有答案