How do I set a location condition in Nginx that responds to anything that isn't equal to the listed locations?
I tried:
location !~/(dir1|file2\.php) { rewrite ^/(.*) http://example.com/$1 permanent; } But it doesn't trigger the redirect. It simply handles the requested URI using the rules in the rest of the server configuration.
/aabbccand where are you going to redirect him?location ~ ^/(?!(dir1|file2\.php)) {}