Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试匹配/category/anything,除了/category/paid在 nginx 位置。
我有以下正则表达式,但它不起作用。谷歌告诉我,我可以在 nginx 中使用前瞻。难道我做错了什么?
location ^/category(?!/paid)/ { }
您要么需要一个斜线,要么需要一个转义的斜线。
location ~ (category/(?!paid)) { .. } location ~ (category\/(?!paid)) { .. }