Index: modules/proxy/mod_proxy.c =================================================================== --- modules/proxy/mod_proxy.c (revision 1520080) +++ modules/proxy/mod_proxy.c (working copy) @@ -1424,6 +1424,9 @@ int use_regex = is_regex; unsigned int flags = 0; const char *err; + int interpolated_scheme = FALSE; + char *scheme = NULL; + const char *c; err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES); if (err) { @@ -1536,10 +1539,27 @@ proxy_worker *worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, r); int reuse = 0; if (!worker) { + if (flags & PROXYPASS_INTERPOLATE) { + if (!strncmp(r, "${", 2)) { + c = ap_strchr_c(r, ':'); + if (c != NULL && *(c - 1) == '}') { + scheme = apr_pstrndup(cmd->temp_pool, r, c - r); + r = apr_pstrcat(cmd->temp_pool, "http", c, NULL); + interpolated_scheme = TRUE; + } + } + } + const char *err = ap_proxy_define_worker(cmd->pool, &worker, NULL, conf, r, 0); if (err) return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL); + if (interpolated_scheme) { + if (PROXY_STRNCPY(worker->s->scheme, scheme) != APR_SUCCESS) { + return apr_pstrcat(cmd->temp_pool, "worker scheme (%s) too long", scheme); + } + } + PROXY_COPY_CONF_PARAMS(worker, conf); } else { reuse = 1;