Bug #729
closedIncorrect PATH_INFO when FastCGI is serving "/"
Description
When mod_fastcgi is serving "/" i.e. configured as following
fastcgi.server = ( "/" => ( ... ) )
it produces wrong SCRIPT_NAME and PATH_INFO.
For example, request for /test/url is represented as
SCRIPT_NAME = "/test" PATH_INFO = "/url"
while it has to be
SCRIPT_NAME = "" PATH_INFO = "/test/url"
Interesting that mod_scgi doesn't have that issue.
Files
Updated by Anonymous over 18 years ago
This occurs when mapping any URL ending in "/" to FastCGI. The same mapping with the ending "/" removed works correctly.
-- mgood
Updated by Anonymous over 18 years ago
This causes problems for trac, when it is sitting in the root directory. See trac bug 2418.
-- teg
Updated by Anonymous almost 18 years ago
Any idea why this has not been checked in? It doesn't look hackish, given we also port it to all places using the same code.
Updated by Anonymous almost 18 years ago
FWIW, the above patch fixes this bug for mod_scgi as well (in my case, tested with DrProject).
-- shot
Updated by Anonymous over 17 years ago
I've been hit by the same problem when trying to use Moin as the root URI.
There is no straightforward solution to this, as there is no generic pattern for splitting the URI in SCRIPT_NAME and PATH_INFO. In some cases you want the whole URI in PATH_INFO, in some other cases you want SCRIPT_NAME to be set, and you could imagine thousands of other cases.
I'd like this to be fixed by a URI => PATH_INFO mapping, with a new configuration variable. The result could look like this:
fastcgi.path_info = (
"^/(admin|stats)/(.*)" => ("/$1", "/$2"),
"^(.*)$" => ("", "$1"),
)
This way /admin/foo would lead to SCRIPT_NAME="/admin" and PATH_INFO="/foo", while /bar would lead to SCRIPT_NAME="" and PATH_INFO="/bar".
-- joss
Updated by Anonymous over 17 years ago
The problem is still present on 1.4.16...
-- lindevel
Updated by Anonymous almost 17 years ago
And still in 1.4.18, it seems...
-- lindevel
Updated by Anonymous over 16 years ago
This patch works great for me. I couldn't get a Mercurial repository (hgwebdir cgi script) working on my web server without it.
Please include it!
-- schnouki
Updated by moo over 16 years ago
this problem is fixed in 1.5.0, i'm working out a solution to this for 1.4.x
Updated by moo over 16 years ago
- Status changed from Assigned to Fixed
- Resolution set to fixed
fixed in r2182, use "fix-root-scriptname" => "enable" to workaround, untested yet. can u pls test it?
Updated by stbuehler over 15 years ago
- Target version changed from 1.4.20 to 1.4.23
Didn't work, fixed in r2421 (fastcgi) and r2498 (scgi).
Also available in: Atom