reverse prox error page/logging when upstream server is having problems

David Taveras d3taveras38d3 at
Sun Feb 14 08:23:22 MSK 2010


I have a reverse proxy up and would like to replace the 504 Gateway
timeout with an error page.

I saw that we have these options when doing loadbalancing:

  proxy_next_upstream       error timeout invalid_header;

 ## Backend servers (web1 is the primary and web2 will come up if web1 is down)
  upstream webbackend  {
    server web1.domain.lan weight=10 max_fails=3 fail_timeout=30s;
    server web2.domain.lan weight=1 backup;

When I have a single backend server (do not deploy load balancing)
What is the best way to redirect those cases (error timeout
invalid_header) to error pages , and also a log?

 Is there any other possible error that iam missing that would
indicate problems with the backend server?



More information about the nginx mailing list