开发者

Have location block with multi or condition on seperate line nginx

开发者 https://www.devze.com 2022-12-07 18:54 出处:网络
We want to send 30 specific url to a new service and rest traffic will go to old service. So i created a location block with those 30 url

We want to send 30 specific url to a new service and rest traffic will go to old service. So i created a location block with those 30 url

 location ~* ^(/a|/b|/c|/d)$ {}

But the issue is its too hard to add url on same line. I tried writing on different line but it gives error

location ~* ^(/a|
/b)$ {开发者_运维问答

Error

nginx: [emerg] invalid number of arguments in "location" directive in /usr/nginx/conf/nginx.conf:43

Is there some way to write multi url path in same location block but on different lines.

0

精彩评论

暂无评论...
验证码 换一张
取 消