I plan to use nginx's subs_filter
to replace certain links or strings, but nginx's regular rules seem to be a little different from those of python and the like. . Here are the tried matches
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
}
Can you please elaborate? grateful
我想大声告诉你2017-05-16 17:11:29
subs_filter https://(.*).wikipedia.org http://wiki.example.org ir;
i
表示忽略大小写r
means the preceding one is regular