Welcome! Log In Create A New Profile

Advanced

Re: Strange error_page behavior

Francis Daly
August 07, 2020 03:06AM
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
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: 312
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