Index: docs/manual/mod/mod_proxy.xml =================================================================== --- docs/manual/mod/mod_proxy.xml (revision 649505) +++ docs/manual/mod/mod_proxy.xml (working copy) @@ -663,6 +663,16 @@ in the pool the Apache will return SERVER_BUSY status to the client. + disablereuse + Off + This parameter should be used when you want to force mod_proxy + to immediately close a connection to the backend after being used, and + thus, disable its persistant connection and pool for that backend. + This helps in various situations where a firewall between Apache and + the backend server (irregardless of protocol) tends to silently + drop connections. To prevent mod_proxy from reusing the backend connection, + set this property value to On. + flushpackets off Determines whether the proxy module will auto-flush the output Index: CHANGES =================================================================== --- CHANGES (revision 649505) +++ CHANGES (working copy) @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.9 + *) Added 'disablereuse' option for ProxyPass which, essentially, + disables connection pooling for the backend servers. + [Jim Jagielski] + *) mod_speling: remove regression from 1.3/2.0 behavior and drop dependency between mod_speling and AcceptPathInfo. PR 43562 [Jose Kahan ] Index: modules/proxy/proxy_util.c =================================================================== --- modules/proxy/proxy_util.c (revision 649505) +++ modules/proxy/proxy_util.c (working copy) @@ -1617,7 +1617,8 @@ #endif /* determine if the connection need to be closed */ - if (conn->close_on_recycle || conn->close) { + if (conn->close_on_recycle || conn->close || worker->disablereuse || + !worker->is_address_reusable) { apr_pool_t *p = conn->pool; apr_pool_clear(conn->pool); memset(conn, 0, sizeof(proxy_conn_rec)); @@ -1771,8 +1772,13 @@ if (!worker->retry_set) { worker->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY); } - /* By default address is reusable */ - worker->is_address_reusable = 1; + /* By default address is reusable unless DisableReuse is set */ + if (worker->disablereuse) { + worker->is_address_reusable = 0; + } + else { + worker->is_address_reusable = 1; + } #if APR_HAS_THREADS ap_mpm_query(AP_MPMQ_MAX_THREADS, &mpm_threads); @@ -1984,7 +1990,8 @@ * * TODO: Handle this much better... */ - if (!conn->hostname || !worker->is_address_reusable || + if (!conn->hostname || !worker->is_address_reusable || + worker->disablereuse || (r->connection->keepalives && (r->proxyreq == PROXYREQ_PROXY || r->proxyreq == PROXYREQ_REVERSE) && (strcasecmp(conn->hostname, uri->hostname) != 0) ) ) { Index: modules/proxy/mod_proxy.c =================================================================== --- modules/proxy/mod_proxy.c (revision 649505) +++ modules/proxy/mod_proxy.c (working copy) @@ -168,6 +168,15 @@ return "KeepAlive must be On|Off"; worker->keepalive_set = 1; } + else if (!strcasecmp(key, "disablereuse")) { + if (!strcasecmp(val, "on")) + worker->disablereuse = 1; + else if (!strcasecmp(val, "off")) + worker->disablereuse = 0; + else + return "DisableReuse must be On|Off"; + worker->disablereuse_set = 1; + } else if (!strcasecmp(key, "route")) { /* Worker route. */ Index: modules/proxy/mod_proxy.h =================================================================== --- modules/proxy/mod_proxy.h (revision 649505) +++ modules/proxy/mod_proxy.h (working copy) @@ -337,6 +337,8 @@ apr_interval_time_t ping_timeout; char ping_timeout_set; char retry_set; + char disablereuse; + char disablereuse_set; }; /*