LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-04-2011, 11:48 PM   #1
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Rep: Reputation: 0
Equivalent of NGINX proxy_intercept_errors with Apache mod_proxy


Hi,
Is there an equivelent of NGINX' proxy_intercept_errors in Apache mod_proxy/mod_proxy_balancer?
I'm balancing two backend PHP/Apache servers, if PHP encounters an error it returns a blank, or partial page with a 500 error, I want (need) Apache to intercept these errors and replace them with a static page on the front-end server.
-Sam
 
Old 04-05-2011, 12:56 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

This isn't working with a php blank page (that actually returns a 200 error code), but for the rest of errors (like 4xx, 5xx) you can use ErrorDocument with ProxyErrorOverride like this:
Code:
ErrorDocument 500 http://proxy/error.html
ProxyErrorOverride On
#Usual reverse proxy directives
ProxyRequests Off
ProxyPass ...
...
HTH
 
1 members found this post helpful.
Old 04-05-2011, 11:53 PM   #3
samarudge
Member
 
Registered: Nov 2010
Posts: 33

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

This isn't working with a php blank page (that actually returns a 200 error code), but for the rest of errors (like 4xx, 5xx) you can use ErrorDocument with ProxyErrorOverride like this:
Code:
ErrorDocument 500 http://proxy/error.html
ProxyErrorOverride On
#Usual reverse proxy directives
ProxyRequests Off
ProxyPass ...
...
HTH
Yes that's exactly what I'm looking for, thank-you
Some pages seem to return 500 errors and others don't, I think it depends on whether the error occurs before the output starts, we use mustache templates so all our processing happens before the first output so most pages return 500 errors (Unless it's an error with mustache).
-Sam
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache mod_proxy and virtualhost dexznrl Linux - Server 1 11-03-2010 05:58 PM
Apache mod_proxy log mahmoud Linux - Software 1 06-07-2010 01:54 AM
about the URL when using Apache mod_proxy myhnet Linux - Newbie 0 06-24-2008 07:08 AM
Apache + Mod_proxy ProxyPass paul_mat Linux - Networking 2 04-14-2006 08:57 PM
Apache 1.3 mod_proxy no cache mago Linux - Software 0 04-07-2006 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration