Nginx not respecting locations execution ordering

c0nw0nk nginx-forum at forum.nginx.org
Tue Apr 17 22:13:13 UTC 2018


So I have a location setup like this.

location /media/files/ {
add_header X-Location-Order First;
}
location ~*
\.(ico|png|jpg|jpeg|gif|flv|mp4|avi|m4v|mov|divx|webm|ogg|mp3|mpeg|mpg|swf|css|js)$
{
add_header X-Location-Order Second;
}


When I access URL : domain_name_dot_com/media/files/image.jpg

The Header response is X-Location-Order: Second


I want it to be using the first location for all URL's that match that not
the regex location can anybody help ?

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



More information about the nginx mailing list