Welcome! Log In Create A New Profile

Advanced

Re: Nested location block for merging config returns 404?

Jonathan Matthews
January 21, 2014 08:36AM
On 21 January 2014 13:29, WheresWardy <nginx-forum@nginx.us> wrote:
> I just get a 404 returned for the previously workings URLs:
>
> location ~ /(dir1/)?dir2/ {
> location \.(txt|css) {
> add_header X-My-Static value2;
> }
> add_header X-My-Header value1;
> proxy_pass http://myproxy;
> }
>
> Can location blocks actually be nested in this way?

I believe they can be, staticprefix-inside-regex as you've done. The
norm is to have regex-inside-staticprefix, and it's usually done for
performance reasons. I suggest you've made an error in not marking
your inner location as a regex, however, and this may be causing your
404s.

Jonathan

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

Nested location block for merging config returns 404?

WheresWardy January 21, 2014 08:29AM

Re: Nested location block for merging config returns 404?

Jonathan Matthews January 21, 2014 08:36AM

Re: Nested location block for merging config returns 404?

WheresWardy January 21, 2014 08:40AM

Re: Nested location block for merging config returns 404?

Jonathan Matthews January 21, 2014 08:50AM

Re: Nested location block for merging config returns 404?

WheresWardy January 21, 2014 08:59AM

Re: Nested location block for merging config returns 404?

Jonathan Matthews January 21, 2014 09:12AM

Re: Nested location block for merging config returns 404?

Valentin V. Bartenev January 21, 2014 11:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
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