Multiple error_page @fallbacks

Hey Everyone:

I use Nginx with Perl and Memcache, but not sure how to redirect if BOTH
Perl and Memcached give me a 502… Memcached passes a 502 to the PERL
script, which if error “should” go to the 502 error page, but it
doesn’t, with or without the “error_page” directive in the @fallback.

Sorry if I’m missing something, but is a double-error redirect possible?

As an example, the following results in Nginx’s default error page:

location ~ ^/search/.* {

default_type text/html;
add_header      "Content" "text/html; charset=utf8";
charset         utf-8;
set             $memcached_key $request_uri;
error_page         404 502 = @fallback;


location @fallback {

gzip off;
fastcgi_pass  unix:/var/run/nginx/perl_cgi-dispatch.sock;
fastcgi_param SCRIPT_FILENAME /some/path/to/cgi-bin/;
include fastcgi_params;

error_page         404 502 =  /some/path/to/error.html;


error_page 502 /some/path/to/error.html;

Posted at Nginx Forum:


recursive_error_pages on;

Doh! RTFM!


Posted at Nginx Forum: