Welcome! Log In Create A New Profile

Advanced

RE: Nginx not respecting locations execution ordering

Reinis Rozitis
April 17, 2018 06:22PM
> 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 ?


Change the first block to:

location ^~/media/files/ {
add_header X-Location-Order First;
}

"If the longest matching prefix location has the “^~” modifier then regular expressions are not checked."

http://nginx.org/en/docs/http/ngx_http_core_module.html#location

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx not respecting locations execution ordering

c0nw0nk April 17, 2018 06:13PM

RE: Nginx not respecting locations execution ordering

Reinis Rozitis April 17, 2018 06:22PM

Re: RE: Nginx not respecting locations execution ordering

c0nw0nk April 17, 2018 06:35PM

Re: Nginx not respecting locations execution ordering

Igor Sysoev April 18, 2018 03:10AM

Re: Nginx not respecting locations execution ordering

c0nw0nk April 18, 2018 05:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready