如何在nginx位置正则表达式中多次匹配?
似乎{x,x}语法永远不会有效!
例如:
location ~ ^/abc/\w{1,3}$ {
...
}
Run Code Online (Sandbox Code Playgroud)
神经工作!
您必须引用包含{或;字符的位置.
location ~ "^/abc/\w{1,3}$" {
...
}
Run Code Online (Sandbox Code Playgroud)
否则nginx解析它location ~ ^/abc/\w { 1, ...并因语法错误而失败.