You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2010/09/24 21:01:57 UTC
DO NOT REPLY [Bug 49996] New: Proxied ErrorDocument returns 200 OK
response code
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
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
AssignedTo: bugs@httpd.apache.org
ReportedBy: lmeyer@vmware.com
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
</Location>
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,
etc.
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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 49996] Proxied ErrorDocument returns 200 OK response code
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
Igor Mihalik <ig...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |igor.mihalik@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 49996] Proxied ErrorDocument returns 200 OK
response code
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
--- Comment #1 from William A. Rowe Jr. <wr...@apache.org> 2010-09-24 15:49:37 EDT ---
What about IgnoreErrorDocumentStatus on/off?
Better suggestions for the name?
There are legitimate reasons to use the result code of a crafty error document
handler, so we need to distinguish between "here, have this status instead",
and "ignore me, here's your error result text".
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 49996] Proxied ErrorDocument returns 200 OK
response code
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
--- Comment #3 from William A. Rowe Jr. <wr...@apache.org> 2010-11-29 20:07:42 EST ---
"is there a reason for ProxyPass to overwrite an existing status code?"
Yes. The nature of the response defines what status it will present.
E.g. it is equally valid to present a redirect, or an OK document in response
to some error conditions. This is all on the implementer to decide.
A new directive would give implementers more flexibility to avoid correcting
their obtuse cgi based or proxy based successful (200) error documents as
non-success pages.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 49996] Proxied ErrorDocument returns 200 OK
response code
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
Luke Meyer <lm...@vmware.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |49997
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 49996] Proxied ErrorDocument returns 200 OK
response code
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49996
Luke Meyer <lm...@vmware.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P3
--- Comment #2 from Luke Meyer <lm...@vmware.com> 2010-09-28 14:42:25 EDT ---
(In reply to comment #1)
> There are legitimate reasons to use the result code of a crafty error document
> handler
Yes, but is there a reason for ProxyPass to overwrite an existing status code?
If there's to be a directive for this, then perhaps:
ErrorDocumentStatus keep (default override)
or
ErrorDocumentKeepStatus on (default off)
- so that it's clearly related to ErrorDocument and next to it in the docs.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org