How do I exclude one folder from a try_files?

Joergi nginx-forum at forum.nginx.org
Sun Jun 25 11:50:10 UTC 2017


Thanks for the notes!

I am on a shared server and there already is some kind of server
configuration. I sadly cannot even see this server config, but I know it
contains lots of location blocks, which at least partly interfere with what
I am trying to do. That is why I use modifiers to make _my_ blocks kick in
instead of theirs. You might say I should change the host ... sadly it's not
so easy... :-(

So back to my problem:

I already do have this location block in my config:

location /wiki/images {
	# Separate location for /wiki/images
	try_files $uri =404;
}

However, the rewriting from location ~* "^/" { } is still taking place also
inside folder /wiki/images. I want nginx to return the existing file or
error 404. Shouldn't my block do exactly that? 

Jörg

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275123,275128#msg-275128



More information about the nginx mailing list