本人打算使用nginx的subs_filter进行某些链接或者字符串的替换,但nginx的正则似乎和python之类的正则有点出入。。下面是试过的匹配
location / {
#目的是将https://*.wikipedia.org替换成http://wiki.example.org
subs_filter .wikipedia.org .wiki.example.org;#这个只能替换成https://wiki.example.org
#也尝试过 subs_filter https://zh.wikipedia.org http://zh.wiki.example.org 但不行,会变成https://zhhttp://example.org
}
请问可否详细说说?感谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
subs_filter https://(.*).wikipedia.org http://wiki.example.org ir;i表示忽略大小写r表示前面是正则