summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/manual/mod/mod_proxy_fcgi.xml17
-rw-r--r--modules/proxy/mod_proxy_fcgi.c8
2 files changed, 22 insertions, 3 deletions
diff --git a/docs/manual/mod/mod_proxy_fcgi.xml b/docs/manual/mod/mod_proxy_fcgi.xml
index 6ddcfd7751..150c44f32b 100644
--- a/docs/manual/mod/mod_proxy_fcgi.xml
+++ b/docs/manual/mod/mod_proxy_fcgi.xml
@@ -96,4 +96,21 @@
</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>
diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c
index 7d1b41e2d3..6ebd6d2a85 100644
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -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;
}