I want an nginx location directive that would match all urls with "xyz" and not match ".php"
I tried this
location ~* /(.*)xyz/(.*)(?!\.php)(.*)$ {}
but for example it always seem to match both /xyz/1 and /xyz/1.php but it should have matched only /xyz/1