Welcome! Log In Create A New Profile

Advanced

Re: Strange error_page behavior

Fabiano Furtado Pessoa Coelho
August 07, 2020 09:32AM
Thanks for the reply and I'm sorry! It was my fault that I didn't see
that text in the documentation.

"These directives are inherited from the previous level if and only if
there are no error_page directives defined on the current level."

On Fri, Aug 7, 2020 at 4:05 AM Francis Daly <francis@daoine.org> wrote:
>
> On Thu, Aug 06, 2020 at 09:43:46PM -0300, Fabiano Furtado Pessoa Coelho wrote:
>
> Hi there,
>
> > http {
> > error_page 502 503 /my503.html;
> > ...
> > server {
> > ...
> > error_page 403 =503 /my503.html;
> > #error_page 502 503 /my503.html;
>
> > I can solve this issue uncommenting the "#error_page 502 503
> > /my503.html;" line in server block, but this configuration is already
> > defined in http block, which is hierarchically superior in comparison
> > with server block. Why NGINX isn't regarging the error_page in http
> > block?
>
> Nginx directive inheritance is (in general) "by replacement" or "not
> at all".
>
> If you have a directive in a location, that is the full set of
> that-directives that applies to the matching request.
>
> Since you have an error_page at server{} level, any error_page defined
> at http level is irrelevant for any request handled in this server{}.
>
> http://nginx.org/r/error_page
>
> If you want a distinct set of error_page directives to apply at
> server{}-level, you must write them all there (perhaps by "include"ing
> a file).
>
> f
> --
> Francis Daly francis@daoine.org
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Strange error_page behavior

Fabiano Furtado Pessoa Coelho August 06, 2020 08:46PM

Re: Strange error_page behavior

Francis Daly August 07, 2020 03:06AM

Re: Strange error_page behavior

Fabiano Furtado Pessoa Coelho August 07, 2020 09:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 51
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready