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