It is simple, but it can be difficult to see. The second (. *) In the regular expression is "greedy", therefore, it will capture everything, including ".php", therefore for the "eyes" of the parsing is "no" .php after it (it has already passed) and the result is match .: (
Just do the second one. * lazy changing it to. *? and it will solve your problem:
location ~* /(.*)xyz/(.*?)(?!\.php)(.*)$ {}
I suggest you read this article , this explains it much better than me: D
source
share