logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Tweak the HTTP response from apache proxy server
Author
psd_mpl



Joined: 15 Jul 2016
Posts: 4
Location: Bangalore

PostPosted: Sun 17 Jul '16 6:12    Post subject: Tweak the HTTP response from apache proxy server Reply with quote

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 Smile

----

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

PostPosted: Fri 22 Jul '16 0:15    Post subject: Reply with quote

You can use Header edit

See http://httpd.apache.org/docs/2.4/mod/mod_headers.html#Header

if you still have a question please ask again.
Back to top


Reply to topic   Topic: Tweak the HTTP response from apache proxy server View previous topic :: View next topic
Post new topic   Forum Index -> Apache