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: mod_proxy ProxyErrorOverride On discards response body
Author
briananderson1222



Joined: 07 Jun 2018
Posts: 1
Location: USA, Chicago

PostPosted: Fri 08 Jun '18 18:55    Post subject: mod_proxy ProxyErrorOverride On discards response body Reply with quote

I am having an issue that may be just a fundamental misunderstanding of how this feature works but wanted to ask nonetheless. I am trying to enable the ProxyErrorOverride directive from the proxy module while using two reverse proxies (one at the root and one at /api). We would like to be able to return Custom ErrorPages (via the ErrorDocument directive) for a range of 4xx and 5xx status codes. There are however status codes that we want to be able to pass through to our web applications as errors that are being explicitly sent from the API. At this current moment whenever I turn on the ProxyErrorOverride directive we do see certain status codes being routed to our generic error page, but the status codes that we try to pass through (by not declaring the ErrorDocument directive) seem to be coming back with the right status code (for example: 418) but using a generic apache response body that says something along the lines of "418 Unknown reason contact your admin@domain.com..blah blah". Is there any way to tell Apache that I want to retain the response body through the proxy or is it always discarded by Apache?

For some context I am using the official 2.4.33 httpd docker base and am able to reproduce this behavior with even the most basic Apache configuration. I tried stepping through some of the source code (I don't write a lot of C) and from what I could tell it seemed that discarding the response body was perhaps the default behavior and that the only override was a custom response.

Would love some clarification on this. Is it possible to pass through error messages with the ProxyErrorOverride directive set to On?

[NOTE]: I tried to post this in the third party modules section and must've posted it here somehow by mistake. Not sure I can move it myself..
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 18 Oct '18 10:44    Post subject: Reply with quote

with ProxyErrorOverride On apache will override any code page that is not of informational (1xx), normal success (2xx), or redirect (3xx) responses

AFAIK there are no exceptions. However on the reverse proxy you are able to use mod_include's SSI that might be able to get the original content. Haven't tried yet.
Back to top


Reply to topic   Topic: mod_proxy ProxyErrorOverride On discards response body View previous topic :: View next topic
Post new topic   Forum Index -> Apache