httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 49996] New: Proxied ErrorDocument returns 200 OK response code
Date Fri, 24 Sep 2010 19:01:57 GMT

           Summary: Proxied ErrorDocument returns 200 OK response code
           Product: Apache httpd-2
           Version: 2.2.15
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_http

I want to reverse proxy error documents from a backend server (to keep them
consistent with the rest of the content/application proxied from there).

I tried the following reverse proxy configuration:
<Location /public>
   ProxyPass http://backend:8080/public
ErrorDocument 404 /public/404.html
... with backend:8080 configured to serve up a valid 404 document for
/public/404.html requests.

When I request a URL that does not exist on my reverse proxy, I get a 200 OK
response instead of a 404 response code, along with the correct error document
body from the backend. This is obviously confusing for caching, automation,

Evidently with a ProxyPass the response code from the backend is used as the
response code for the original request. Normally this would make sense, but not
when a response code has already been set and we're just getting content to go
with it. For reference, if instead we use a CGI script as the ErrorDocument and
don't specify a new response code, the original response code is retained.

This suggests a relatively simple approach: upon returning successfully from a
ProxyPass, check to see if the response already has a code, and leave it if so.
AFAICS the only scenario where this would make a difference is the one I've
described; in which case this handling offers the least surprising result.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message