Project

General

Profile

Feature #974

would like something similar to nginx proxy_intercept_errors

Added by yusufg over 10 years ago. Updated 7 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

nginx has a neat feature in which it can intercept responses with HTTP status code of 400 and higher

http://wiki.codemongers.com/NginxHttpProxyModule#proxy_intercept_errors

The error page handler allows one to change the response status code also

http://wiki.codemongers.com/NginxHttpCoreModule#error_page

here's how one would would redirect 4xx/5xx responses from backend

error_page 401 402 404 /40x.html;
location /40x.html {
root /errors/ ;
}

error_page 502 503 504 /50x.html;
location /50x.html {
root /errors/ ;
}

upstream backend {
server backend2.example.com:8080;
}

location / {
proxy_intercept_errors on;
proxy_pass backend
}

Associated revisions

Revision 8f651a2b (diff)
Added by gstrauss 7 months ago

[core] config opt to intercept dynamic handler err (fixes #974)

new directive server.error-intercept = [ "enable" | "disable" ]
to intercept 4xx and 5xx responses from dynamic handlers
(e.g. CGI, FastCGI, SCGI, proxy)

Intercepted HTTP error status are then handled by one of
server.error-handler
server.error-handler-404
server.errorfile-prefix
(if configured)

Do not use server.error-intercept with locations handled by mod_webdav!

x-ref:
"would like something similar to nginx proxy_intercept_errors"
https://redmine.lighttpd.net/issues/974

History

#1 Updated by gstrauss 7 months ago

  • Description updated (diff)
  • Status changed from New to Patch Pending
  • Assignee deleted (jan)
  • Target version set to 1.4.46

#2 Updated by gstrauss 7 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom