2 messages in ru.sysoev.nginxCan error_pages be used to intercept ...
FromSent OnAttachments
Yusuf GoolamabbasJun 14, 2006 9:44 pm 
Igor SysoevJun 15, 2006 10:20 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Can error_pages be used to intercept a 404 response from an upstream backendActions...
From:Yusuf Goolamabbas (yusu@public.gmane.org)
Date:Jun 14, 2006 9:44:26 pm
List:ru.sysoev.nginx

Hi, I have been able to use error_page for error code 502,503,504 when nginx is used as a reverse proxy. Is it possible to use error_page to handle 403,404 responses from the upstream and replace it with an error_page specifed in nginx

I tried to use the following

error_page 404 /40x.html; location /40x.html { root /tux/ ; }

But when I request the URL (which doesn't exist), I get the response generated by the upstream backend server

The corresponding stanza for 50x codes work correctly (when the upstream backend is not answering)

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