Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Tweak the HTTP response from apache proxy server |
|
Author |
|
psd_mpl
Joined: 15 Jul 2016 Posts: 4 Location: Bangalore
|
Posted: Sun 17 Jul '16 6:12 Post subject: Tweak the HTTP response from apache proxy server |
|
|
I have apache proxy server FrontEnd and BackEnd . In Apache BackEnd Server ,the proxypass URL is throwing connection timeout error that is Error Code 502/503 .The same error response is sent back to Front End .
Now I want to tweak the HTTP Status code in Apache Proxy Server BackEnd before sending it Apache Proxy Server FrontEnd.
The logic should be something like this
<Location "/">
ProxyPass "https://www.connectiontimeouturl.com/"
ProxyPassReverse "https://www.connectiontimeouturl.com/"
// just a logic
if(http_status from proxypass == 502 / 503)
{
tweak the response and then send it to apache FE
}
</Location>
Is there any other solution for this issue??
I just want to manipulate the HTTP status code before sending the response to FE.
Any other alternative solution will be appreciated
----
I have a apache proxy server setup in windows and linux.
The configuration of httpd.conf are same in both windows and linux .Here is the conf
<Location "/">
#adding Error document details
ErrorDocument 502 ${serverroot}/file.html
ErrorDocument 503 ${serverroot}/file.html
ProxyPass "https://someurl.com"
ProxyPassReverse "https://someurl.com"
</Location>
So whenever the proxypass throws the error 502/503 , it redirects it to error document i.e to the page file.html.
When I checked the access logs , found the difference in the response in windows and linux systems.
In windows --- > POST / HTTP/1.1" 302
In Linux ----- > POST / HTTP/1.1" 502
Why there is difference in response ??
Error code 302 is redirection code .Why windows is sending redirection error code but not linux ???
Mod Note merged cross topics |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|