尝试
location ~ /.+?(?=customer\/)(?!customer\/510|customer\/10638)(.*\/edit|.*\/new|.*\/archive) {
# TEST URL FOR NOT ALLOWED REQUESTS
return 301 https://www.google.com;
}
但是,请注意之后的任何内容都将被删除,因为它是一个锚元素,所以请求如下
https://subdomain.domainname.com/#/customer/521/installations/new
将作为
GET /
并被路由到第一个位置块
但是,像这样的请求
https://subdomain.domainname.com/hello/customer/521/installations/new
将被路由到
https://google.com