Welcome! Log In Create A New Profile

Advanced

nested error_page

December 14, 2010 02:12AM
hi

i have a situtation where i would need something similar to this:

location / {
error_page 404 = /fallback_all;
// do a request to get content from memcache, if not found go to /fallback_all
}

location = /fallback_all {
internal;
error_page 404 = @404;
// do a request to get content from fastcgi, if not found go to @404
}

location @404 {
internal;
// real 404 page
}

but this doesn't work. if the fastcgi returns a 404 then nginx will
just display its own error page and ignore the second error_page
directive. i'm guessing that the reason is that at the first 404 error
it already sets the ngx_http_request_t->err_status to something which
makes it ignore the second 404.

is there any way around this? i could probably make the fastcgi return
some other code, but i'm also not sure if this will make it work then.
is there any directive which could make the second error_page work?
something to allow nested error_pages

thanks,

mauro

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

nested error_page

replay December 14, 2010 02:12AM

Re: nested error_page

Igor Sysoev December 14, 2010 02:16AM

Re: nested error_page

replay December 14, 2010 02:22AM

Re: nested error_page

Maxim Dounin December 14, 2010 06:56AM

Re: nested error_page

Igor Sysoev December 14, 2010 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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