所以我有一个基于正则表达式的定位规则,这样的事情:Nginx的 - 正则表达式的位置
location ~ /(abc.*xyz|def.*zxy|ghk.*qwe)/
我可以检查哪些正则表达式的一部分,得到了比赛? 意思就是比我想如果URL像
/12abc34/
知道它是由
.*abc.*
有没有办法匹配?
我正在使用AWS上的Debian VM运行最新的使用lua-module编译的nginx。
------------更新-------------
我想用内部的位置,但是这将是丑陋:
location ~ /(abc.*xyz|def.*zxy|ghk.*qwe)/
{
location ~ /(abc.*xyz){...}
location ~ /(def.*zxy){...}
...
}
现在我有60个正则表达式模式。这样的方法好吗?
你有没有考虑过使用'map'和'$ request_uri'?有关详细信息,请参见[本文档](http://nginx.org/en/docs/http/ngx_http_map_module.html#map)。 –