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.
我将 nginx 用于 API 并且我的重写是在 Vhost 中,并且我遇到了正则表达式的问题。
我的网址可以是:
第一个适用于此:
rewrite /products/([A-Z0-9]+)/ /products.php?ids=$1 last;
我用 % 尝试了很多东西,但我已经有了 HTTP 400
谢谢
编辑 :
rewrite "^/products/([A-Z0-9]+)\%{0,1}.*$" /products.php?ids=$1 last;
应该始终匹配第一个 idBR3TMVZ9PNWZ
BR3TMVZ9PNWZ