Welcome! Log In Create A New Profile

Advanced

Multiple error_page @fallbacks

June 14, 2010 04:34PM
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;
memcached_pass 127.0.0.1:11211;
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/search.pl;
include fastcgi_params;

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

}

error_page 502 /some/path/to/error.html;
Subject Author Posted

Multiple error_page @fallbacks

Goldcap June 14, 2010 04:34PM

Re: Multiple error_page @fallbacks

Goldcap June 14, 2010 04:43PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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