Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#495 closed defect (invalid)

error_page 497 handling resulting in 504 error doesn't use configured 504 error page

Reported by: Richard Zschech Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.5.x
Keywords: Cc:
uname -a: MINGW32_NT-6.1 TS02348 1.0.12(0.46/3/2) 2011-07-20 17:52 i686 unknown
nginx -V: nginx version: nginx/1.5.9
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/ --http-log-path=logs/access.log --er
ror-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fas
tcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.34 --with-zlib=objs/lib/zlib128 --with-openssl=objs/lib/o
penssl-1.0.1f --with-select_module --with-http_ssl_module --with-ipv6 --add-module=nginx_upstream_hash --add-module=nginx-sticky-module --with-http_sp
dy_module --add-module=headers-more-nginx-module


If I try to proxy a HTTP request on the HTTPS port to an upstream with no available servers I get a nginx 504 error page even when a 504 error page is configured. It would be nice if there was a second pass at the error handling so that the configured page is shown.

Here is a simple configuration demonstrating the error. A 50x.html file is also required. Just visit http://localhost:443/ and see the nginx error page.

events {

http {

upstream backend {



error_page 504 @50x;
error_page 497 = @internal_redirect;

server {

listen 80;
listen 443 ssl;

location / {

proxy_pass http://backend;


location @internal_redirect {

proxy_pass http://backend;


location @50x {

rewrite (.*)$ /50x.html break;
root html;




Change History (2)

comment:1 by Valentin V. Bartenev, 10 years ago

Resolution: invalid
Status: newclosed

comment:2 by Richard Zschech, 10 years ago

Ahh, thanks that works

Note: See TracTickets for help on using tickets.