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 51517] New: mod_proxy_fcgi is not RFC 3875 compliant
Date Sat, 16 Jul 2011 23:31:52 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51517

             Bug #: 51517
           Summary: mod_proxy_fcgi is not RFC 3875 compliant
           Product: Apache httpd-2
           Version: 2.3.12-beta
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_proxy_fcgi
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ml@fatbsd.com
    Classification: Unclassified


Hello,

I'm the maintener and developper behind php-fpm. I've been playing with apache
2.3.12 and FPM and I discover that mod_proxy_fcgi is not RFC 3875 compliant.

According to RFC 3875, with the URL
'http://www.mysite.com/path/to/test.php/toto?foo=bar' the following FASTCGI
variables must be send to the fastcgi server:
- SCRIPT_NAME=/path/to/test.php
- QUERY_STRING=foo=bar
- PATH_INFO=/toto
- PATH_TRANSLATED=%{DOCUMENT_ROOT}/toto

I've configured mod_proxy_fcgi this way for my tests:

  DocumentRoot /home/fat/web/docs/php
  SetEnvIf Request_URI . proxy-fcgi-pathinfo=1
  ProxyPassMatch ^/(.+\.php.*)$ fcgi://127.0.0.1:9000/$1

And it sends the following FASTCGI variables:
- SCRIPT_NAME=(empty string)
- QUERY_STRING=foo=bar
- PATH_INFO=/path/to/test.php/toto
-
PATH_TRANSLATED=proxy:fcgi://127.0.0.1:9000/path/to/test.php/toto/path/to/test.php/toto
- DOCUMENT_ROOT=/home/fat/web/docs/php
- SCRIPT_FILENAME=proxy:fcgi://127.0.0.1:9000/path/to/test.php/toto
- REQUEST_URI=/path/to/test.php/toto?foo=bar

as you see:
- SCRIPT_NAME is not set (it's set to /path/to/test.php/toto if
proxy-fcgi-pathinfo is not set)
- QUERY_STRING is set correctly
- PATH_INFO is not correct as it should be set to '/toto'
- PATH_TRANSLATED is not correct as it should be set to
/home/fat/web/docs/php/toto

- DOCUMENT_ROOT is set correctly even if this variable is not defined in the
RFC
- REQUEST_URI is set correctly even if this variable is not defined in the RFC
- SCRIPT_FILENAME is set not correctly even if this variable is not defined in
the RFC. It should be set to '/home/fat/web/docs/php/path/to/test.php'.

I didn't really checked other fastcgi variables.

Then, I've made the test with the URL
'http://www.mysite.com/path/to/test.php/toto?foo=bar' (I removed the /toto
after the script name, which is a more common usage I think). mod_proxy_fcgi
should send:
- SCRIPT_NAME=/path/to/test.php
- QUERY_STRING=foo=bar
- PATH_INFO=(empty string)
(PATH_TRANSLATED must not be send when PATH_INFO is empty)

and it sends with proxy-fcgi-pathinfo:
- SCRIPT_NAME=(empty string)
- QUERY_STRING=foo=bar
- PATH_INFO=/path/to/test.php
- PATH_TRANSLATED=proxy:fcgi://127.0.0.1:9000/path/to/test.php/path/to/test.php
- SCRIPT_FILENAME=proxy:fcgi://127.0.0.1:9000/path/to/test.php
- DOCUMENT_ROOT=/home/fat/web/docs/php
- REQUEST_URI=/path/to/test.php?foo=bar

or without proxy-fcgi-pathinfo:
- SCRIPT_NAME=/path/to/test.php
- QUERY_STRING=foo=bar
- SCRIPT_FILENAME=proxy:fcgi://127.0.0.1:9000/path/to/test.php
- DOCUMENT_ROOT=/home/fat/web/docs/php
- REQUEST_URI=/path/to/test.php?foo=bar


The problem is still the same:
- proxy-fcgi-pathinfo is buggy (SCRIPT_NAME empty and PATH_INFO/TRANSLATED set
to wrong values)
- SCRIPT_FILENAME is not set correctly (proxy:fcgi://127.0.0.1:9000 should be
replace by DOCUMENT_ROOT)

I can make more tests if needed.

I really think mod_proxy_fcgi should be RFC 3875.

Hope it helps
++ jerome

-- 
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