httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51077] mod_rewrite does not pass query string to mod_proxy_fcgi and mod_proxy_scgi
Date Tue, 19 Apr 2011 05:32:21 GMT

Mark Montague <> changed:

           What    |Removed                     |Added
  Attachment #26896|0                           |1
        is obsolete|                            |

--- Comment #5 from Mark Montague <> 2011-04-19 01:32:17 EDT ---
Created an attachment (id=26901)
 --> (
Version 2 - Patch to make mod_rewrite pass query strings to mod_proxy_fcgi and

The original patch resulted in different behavior in virtual host context
versus directory context.

In virtual host context, mod_rewrite finishes with:

2011-04-19 00:23:30.735588 Xs3Z3t0NPeY pid=14843
rewrite:trace1 mod_rewrite.c(468): - -
[][rid#7f17c80129f0/initial] go-ahead with proxy
request proxy:fcgi:// [OK]

However, if the rewrite rule is placed in directory context, the final result
has the query string appended to the URI, which in turn causes mod_proxy_fcgi
to include the query string as a part of the SCRIPT_FILENAME environment
variable, which is unexpected and causes problems for some (many?) back-end
servers, including php-fpm.

2011-04-19 00:25:20.246937 Tc9g5R0PPeY pid=14841
rewrite:trace1 mod_rewrite.c(468): - -
[][rid#7f17c8002970/initial] [perdir /www/html/]
go-ahead with proxy request
proxy:fcgi:// [OK]

The virtual host context case and directory context case do not diverge from
what is expected for each of them until the final trace message (above).

Investigation shows that mod_rewrite.c:hook_uri2file() (which is used for
rewrite rules in server context) uses different tests for determining whether
to append the query string to the filename than mod_rewrite.c:hook_fixup()
(which is used for rewrite rules in directory context).

Version 2 of the patch (attached) fixes the original problem and also modifies
hook_fixup() to use the same logic as hook_uri2file() in order to get
consistent behavior between directory and virtual host contexts for rewrite
rules that use the [P] flag.

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