Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1517111 - Unecessary redirection when ProxyErrorOverride is enabled
Summary: Unecessary redirection when ProxyErrorOverride is enabled
Status: NEW
Alias: None
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: httpd
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Weinan Li
QA Contact: Michal Karm Babacek
Depends On:
TreeView+ depends on / blocked
Reported: 2017-11-24 08:55 UTC by Hisanobu Okuda
Modified: 2018-05-18 21:28 UTC (History)
3 users (show)

Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

Description Hisanobu Okuda 2017-11-24 08:55:38 UTC
Description of problem:
Configured mod_proxy_http, accessing non-existing resource causes the following error:

[Fri Nov 24 17:12:04 2017] [error] [client] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. install EAP and EWS
2. copy the following proxy.conf to /etc/httpd/conf.d

# cat /etc/httpd/conf.d/proxy.conf
ProxyPass        /
ProxyPassReverse /
ProxyErrorOverride On
ErrorDocument 404 "/errors/error404.html"

3. start EAP and EWS
4. access http://localhost:80/no_such_resource/

Actual results:

Expected results:

Additional info:

Comment 1 Hisanobu Okuda 2017-11-24 09:01:29 UTC
Workaround is adding the following line to proxy.conf:

ProxyPass        /errors !

Comment 2 Hisanobu Okuda 2017-11-24 09:04:57 UTC
Root cause:

In http_request.c,  ap_internal_redirect(custom_response, r) is invoked without checking if it is an initial request. The following change might fix the issue (but not confirmed yet. I will do next week)...

[hokuda@dhcp-193-78 http]$ diff -u http_request.c
---  2017-11-24 18:03:36.147785880 +0900
+++ http_request.c      2017-11-24 18:04:16.831967661 +0900
@@ -177,7 +177,7 @@
             r->status = HTTP_MOVED_TEMPORARILY;
             apr_table_setn(r->headers_out, "Location", custom_response);
-        else if (custom_response[0] == '/') {
+        else if (custom_response[0] == '/' && ap_is_initial_req(r)) {
             const char *error_notes;
             r->no_local_copy = 1;       /* Do NOT send HTTP_NOT_MODIFIED for
                                          * error documents! */
[hokuda@dhcp-193-78 http]$

Comment 3 Hisanobu Okuda 2017-11-24 09:05:52 UTC
It seems relevant with

Comment 4 Hisanobu Okuda 2017-11-24 09:06:22 UTC
Same issue is in JBCS 2.4.23 as well

Note You need to log in before you can comment on or make changes to this bug.