So I have a regex-based location rule, something like this:
location ~ /(abc.*xyz|def.*zxy|ghk.*qwe)/
Can I check which part of regex yielded the match? Meaning that if the url was like
/12abc34/
Than I'd like to know that it was matched by
.*abc.*
Is there a way?
I'm running latest nginx compiled with lua-module on a Debian VM on AWS.
------------Update-------------
I'm thinking to use inner location, but it will be ugly:
location ~ /(abc.*xyz|def.*zxy|ghk.*qwe)/
{
location ~ /(abc.*xyz){...}
location ~ /(def.*zxy){...}
...
}
Right now I have like 60 regex patterns. Is such approach ok?