Proxy response on status codes

Topics: Developer Forum
Dec 9, 2010 at 1:24 PM
Edited Dec 9, 2010 at 1:25 PM

Hi

I have searched for too long time on the net and finally decided to ask here as I am using the Rewriter for proxy business.

==SETUP==
Windows Server 2003, IIS 6.0 . latest IIRF

==PURPOSE==
I am proxying a website to hide it from public. People access a subfolder of the main website whoch rewrites the request to the hidden server.
All is well and that part works

==PROBLEM==
Eventually, the load to the remote server we are hiding might get too high and we'll receive a 503 status code. The user will see a service denied from the hidden server.

==REQUIRED==
1) errors from the hidden server shall be covered by our own error pages of the primary site. I found no way yet to obtian the response code, analyse it and redirect/rewrite accordingly when proxing
2) Can I set a timeout in which I will forward to a timeout message sooner than the default 20 seconds when accessing the remote server?

Many thanks for any valuable input.  cannot believe that this is impossible ?

Screwer

Coordinator
Dec 14, 2010 at 1:00 PM

yes, there's a way to set the timeouts associated to proxied requests.  Check the ProxyTimeouts directive.

Using IIRF to handle the proxying, there's no way to inject your own code to handle 503 response codes, or any other response codes received from a proxy request. If you want to specially handle 503's, or any other code, you'll probably have to write your own DLL.  I don't know of an off-the-shelf product that can do that.

What action did you have in mind, anyway?

good luck.

 

Dec 28, 2010 at 9:42 AM

Hi

thanks for the reply - I had overlooked the timeout parameter and consider it in the future.Not sure though, how I will be passing a 503 to a normal error page of the main site (which is not on 503)

 

Coordinator
Dec 29, 2010 at 10:01 AM

If you write your own DLL, then you can handle 503 errors for proxied requests, in any way you choose. 

But writing your own DLL may be more commitment than you are interested in making. If that's the case maybe rethink your design.