httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
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
https://issues.apache.org/bugzilla/show_bug.cgi?id=51077

Mark Montague <mark@catseye.org> changed:

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

--- Comment #5 from Mark Montague <mark@catseye.org> 2011-04-19 01:32:17 EDT ---
Created an attachment (id=26901)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26901)
Version 2 - Patch to make mod_rewrite pass query strings to mod_proxy_fcgi and
mod_proxy_scgi


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 127.0.0.1:36448 127.0.0.1:80
rewrite:trace1 mod_rewrite.c(468): 127.0.0.1 - -
[127.0.0.1/sid#7f17e5faf738][rid#7f17c80129f0/initial] go-ahead with proxy
request proxy:fcgi://127.0.0.1:4000/fcgi-test-rewrite/some/script.php [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 127.0.0.1:52797 127.0.0.1:80
rewrite:trace1 mod_rewrite.c(468): 127.0.0.1 - -
[127.0.0.1/sid#7f17e5faf738][rid#7f17c8002970/initial] [perdir /www/html/]
go-ahead with proxy request
proxy:fcgi://127.0.0.1:4000/fcgi-test-rewrite2/some/script.php?q=hello [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: 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


Mime
View raw message