You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2016/05/23 16:21:29 UTC

[Bug 59618] New: SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

            Bug ID: 59618
           Summary: SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"
           Product: Apache httpd-2
           Version: 2.4.20
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_fcgi
          Assignee: bugs@httpd.apache.org
          Reporter: champion.p@gmail.com

Partial duplicate of 50851, but that bug is an omnibus with quite a bit of
history behind it and this issue is more easily patched.

When using mod_proxy_fcgi with the recommended SetHandler/Proxy architecture:

  Alias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
  <Location /cgi-bin/>
    SetHandler "proxy:fcgi://localhost:4000"
  </Location>

  <Proxy "fcgi://localhost:4000">
  </Proxy>

...the SCRIPT_FILENAME passed to the backend is prefixed with proxy:fcgi:

  [Fri May 20 12:08:40.299263 2016] [proxy_fcgi:trace8] [pid 21189:tid
139785465222912] mod_proxy_fcgi.c(294): [client 127.0.0.1:51060] AH01062:
sending env var 'SCRIPT_FILENAME' value
'proxy:fcgi://localhost:4000/usr/local/apache2/cgi-bin/test-cgi'

This makes it difficult to use with general-purpose FCGI backends, since they
cannot understand the file path. PHP-FPM appears to have been hard-coded to
ignore the prefix as a workaround; see https://bugs.php.net/bug.php?id=54152 .

mod_proxy_fcgi already strips the proxy:balancer prefix; I propose that we add
the proxy:fcgi prefix to that logic as well (or refactor the logic so that the
internal prefixes aren't considered by the environment variable generation, but
that would be significantly more work).

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Jim Jagielski <ji...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #6 from Jim Jagielski <ji...@apache.org> ---
Modifications in 2.4.26 and later provide workarounds for this.

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

--- Comment #2 from Jacob Champion <ch...@gmail.com> ---
Created attachment 33867
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33867&action=edit
An Apache::Test case

Here's a test case for the SCRIPT_FILENAME variable.

Regarding the XXX marker in the patch: I couldn't find a way to get the value
of a @NextAvailablePort@ from inside the test client. Maybe a new Apache::Test
feature is needed? Or we could just hardcode the port number.

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Jacob Champion <ch...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Graham Leggett <mi...@sharp.fm> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Graham Leggett <mi...@sharp.fm> ---
Backported to v2.4.21.

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Szőgyényi Gábor <sz...@freemail.hu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |szg0000@freemail.hu

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

--- Comment #1 from Jacob Champion <ch...@gmail.com> ---
Created attachment 33865
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33865&action=edit
Strip proxy:fcgi as well as proxy:balancer

One possible approach. Patch was made against 2.4.20.

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #3 from Eric Covener <co...@gmail.com> ---
Thanks Jacob, fixed in http://svn.apache.org/r1747810 and proposed for 2.4.x.

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


[Bug 59618] SCRIPT_FILENAME is prefixed with bogus "proxy:fcgi"

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59618

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #5 from Eric Covener <co...@gmail.com> ---
Need go to back to the drawing board on this one, php-fpm was using this prefix
as a hint that this was a non mod_fastcgi / non Action kind of invocation. When
its gone, they're using PATH_TRANSLATED instead of SCRIPT_FILENAME because I
guess that's how some Action-based mod_fastcgi configs worked.

I am tempted to flip the default and just guard it under a directive.

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