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.
只要 url 不仅匹配一个字符串,而且匹配字符串列表中的任何一个,我都想进入位置部分。
就像是:
location ['one', 'two', 'three'] { # do more stuff }
有任何想法吗?
您可以通过使用正则表达式位置来做到这一点:
location ~ "^/(one|two|three)/.*" { #do your stuff }
注意:如果您想要不区分大小写的匹配,请使用~*而不是~
~*
~