Opened 7 years ago

Closed 7 years ago

#281 closed defect (invalid)

proxy_cache_use_stale conflicts with proxy_intercept_errors

Reported by: Oleg Aldekein Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.0.x
Keywords: Cc:
uname -a: Linux vps222906.ukrdomen.com 2.6.18-274.7.1.el5.028stab095.1 #1 SMP Mon Oct 24 20:49:24 MSD 2011 i686 i686 i386 GNU/Linux
nginx -V: nginx version: nginx/1.0.15
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
TLS SNI support disabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-file-aio --with-mail_ssl_module --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --with-ld-opt=-Wl,-E

Description

When using nginx to proxy_pass requests to another webserver I'd like to intercept error pages and show own error.

I set proxy_intercept_errors=on, set the error_page, but when I set "proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;" the 500 error from backend is displayed instead of custom error page.

Change History (1)

comment:1 by Maxim Dounin, 7 years ago

Resolution: invalid
Status: newclosed

As of now, the proxy_intercept_errors status is resolved when storing a response in a cache - like e.g. proxy_cache_valid. This results in a 500 response from a backend being returned if the response was previously cached with proxy_intercept_errors switched off.

Note: See TracTickets for help on using tickets.