<name>ProxyPass</name>
<description>Maps remote servers into the local server URL-space</description>
<syntax>ProxyPass [<var>path</var>] !|<var>url</var> [<var>key=value</var>
- <var>[key=value</var> ...]] [nocanon] [interpolate]</syntax>
+ <var>[key=value</var> ...]] [nocanon] [interpolate] [noquery]</syntax>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context>
</contextlist>
so you may still have to resort to <module>mod_rewrite</module>
for complex rules.</p>
+ <p>Normally, mod_proxy will include the query string when
+ generating the <var>SCRIPT_FILENAME</var> environment variable.
+ The optional <var>noquery</var> keyword (available in
+ httpd 2.4.1 and later) prevents this.</p>
+
<p>When used inside a <directive type="section" module="core"
>Location</directive> section, the first argument is omitted and the local
directory is obtained from the <directive type="section" module="core"
/* mod_proxy_http needs to be told. Different module. */
apr_table_setn(r->notes, "proxy-nocanon", "1");
}
+ if (ent->flags & PROXYPASS_NOQUERY) {
+ apr_table_setn(r->notes, "proxy-noquery", "1");
+ }
return OK;
}
else if (!strcasecmp(word,"interpolate")) {
flags |= PROXYPASS_INTERPOLATE;
}
+ else if (!strcasecmp(word,"noquery")) {
+ flags |= PROXYPASS_NOQUERY;
+ }
else {
char *val = strchr(word, '=');
if (!val) {
#define PROXYPASS_NOCANON 0x01
#define PROXYPASS_INTERPOLATE 0x02
+#define PROXYPASS_NOQUERY 0x04
struct proxy_alias {
const char *real;
const char *fake;
while (to_write) {
apr_size_t n = 0;
rv = apr_socket_sendv(s, vec + offset, nvec - offset, &n);
- if (rv != APR_SUCCESS) {
+ if ((rv != APR_SUCCESS) && !APR_STATUS_IS_EAGAIN(rv)) {
break;
}
if (n > 0) {
const apr_table_entry_t *hdrs = (const apr_table_entry_t *) hdrs_arr->elts;
int i;
apr_port_t rport;
+ char *q;
/* use a temporary apr_table_t which we'll overlap onto
* r->subprocess_env later
apr_table_addn(e, "CONTEXT_PREFIX", ap_context_prefix(r));
apr_table_addn(e, "CONTEXT_DOCUMENT_ROOT", ap_context_document_root(r));
apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
- apr_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
+ if (apr_table_get(r->notes, "proxy-noquery") && (q = ap_strchr(r->filename, '?'))) {
+ *q = '\0';
+ apr_table_addn(e, "SCRIPT_FILENAME", apr_pstrdup(r->pool, r->filename));
+ *q = '?';
+ }
+ else {
+ apr_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
+ }
rport = c->client_addr->port;
apr_table_addn(e, "REMOTE_PORT", apr_itoa(r->pool, rport));