Blob Blame History Raw
diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c
index 41292e8..59dd484 100644
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -321,6 +321,7 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     apr_status_t rv;
     apr_size_t avail_len, len, required_len;
     int next_elem, starting_elem;
+    char *proxyfilename = r->filename;
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
     fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config, &proxy_fcgi_module);
 
@@ -330,40 +331,18 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
        }
     }
 
-    /* Strip proxy: prefixes */
-    if (r->filename) {
-        char *newfname = NULL;
-
-        if (!strncmp(r->filename, "proxy:balancer://", 17)) {
-            newfname = apr_pstrdup(r->pool, r->filename+17);
-        }
-
-        if (!FCGI_MAY_BE_FPM(dconf))  {
-            if (!strncmp(r->filename, "proxy:fcgi://", 13)) {
-                /* If we strip this under FPM, and any internal redirect occurs
-                 * on PATH_INFO, FPM may use PATH_TRANSLATED instead of
-                 * SCRIPT_FILENAME (a la mod_fastcgi + Action).
-                 */
-                newfname = apr_pstrdup(r->pool, r->filename+13);
-            }
-            /* Query string in environment only */
-            if (newfname && r->args && *r->args) {
-                char *qs = strrchr(newfname, '?');
-                if (qs && !strcmp(qs+1, r->args)) {
-                    *qs = '\0';
-                }
-            }
-        }
-
-        if (newfname) {
-            newfname = ap_strchr(newfname, '/');
-            r->filename = newfname;
-        }
+    /* Strip balancer prefix */
+    if (r->filename && !strncmp(r->filename, "proxy:balancer://", 17)) {
+        char *newfname = apr_pstrdup(r->pool, r->filename+17);
+        newfname = ap_strchr(newfname, '/');
+        r->filename = newfname;
     }
 
     ap_add_common_vars(r);
     ap_add_cgi_vars(r);
 
+    r->filename = proxyfilename;
+
     /* XXX are there any FastCGI specific env vars we need to send? */
 
     /* Give admins final option to fine-tune env vars */