]> granicus.if.org Git - apache/commitdiff
Fix/workaround for BUGZ PR 50851.
authorJim Jagielski <jim@apache.org>
Fri, 4 Mar 2011 18:31:17 +0000 (18:31 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 4 Mar 2011 18:31:17 +0000 (18:31 +0000)
By default, mod_proxy_fcgi with not create PATH_INFO, unless
specifically told to.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078089 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_proxy_fcgi.xml
modules/proxy/mod_proxy_fcgi.c

index 6ddcfd7751fbbb095b7ff4d13d0af3be83a14bc0..150c44f32b27dc1c55e874ed87e97bee5450bb09 100644 (file)
     </example>
 </section>
 
+<section id="env"><title>Environment Variables</title>
+    <p>In addition to the configuration directives that control the
+    behaviour of <module>mod_proxy</module>, there are a number of
+    <dfn>environment variables</dfn> that control the FCGI protocol
+    provider:</p>
+    <dl>
+        <dt>proxy-fcgi-pathinfo</dt>
+        <dd>By default <module>mod_proxy_fcgi</module> will neither create
+        nor export the <var>PATH_INFO</var> environment variable. This allows
+        the backend FCGI server to correctly determine <var>SCRIPT_NAME</var>
+        and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
+        If instead you need <module>mod_proxy_fcgi</module> to generate
+        a "best guess" for <var>PATH_INFO</var>, set this env-var.
+        This is a workaround for a bug in some FCGI implementations.</dd>
+    </dl>
+</section>
+
 </modulesynopsis>
index 7d1b41e2d35068ebc8dc42e4ed0ef7cda6de4e7f..6ebd6d2a85e4ab821869a270477a94de58eb8195 100644 (file)
@@ -119,10 +119,12 @@ static int proxy_fcgi_canon(request_rec *r, char *url)
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                   "proxy: FCGI: set r->filename to %s", r->filename);
 
-    r->path_info = apr_pstrcat(r->pool, "/", path, NULL);
+    if (apr_table_get(r->subprocess_env, "proxy-fcgi-pathinfo")) {
+        r->path_info = apr_pstrcat(r->pool, "/", path, NULL);
 
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
-                  "proxy: FCGI: set r->path_info to %s", r->path_info);
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+                      "proxy: FCGI: set r->path_info to %s", r->path_info);
+    }
 
     return OK;
 }