https://bz.apache.org/bugzilla/show_bug.cgi?id=59935
Bug ID: 59935
Summary: apache 2.2 mod_proxy keepalive does not work with
https backend and ProxyRemote *
Product: Apache httpd-2
Version: 2.2-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_proxy
Assignee: [email protected]
Reporter: [email protected]
we noticed in our current setup on apache 2.2 that a ProxyPass to a https
backend with ProxyRemote * always create a new TCP connection when a new
request arrives , although http keepalive is activated
we also noticed this problem is resolved when we upgrade to apache 2.4 with the
same setup
after some testing with a while bunch of different apache versions and patches
we've discovered that r1227642 (
http://svn.apache.org/viewvc?view=revision&revision=1227642 ) , which was
put in branch 2.4 via r1227645 (
http://svn.apache.org/viewvc?view=revision&revision=1227645 ) seems to solve
this keepalive problem in this particular config
we've tested following patch on a 2.2 (diff from 2.2-head)
----------------------
--- proxy_util.c 2016-07-28 02:55:34.000000000 +0200
+++ proxy_util.c 2016-08-02 21:16:59.000000000 +0200
@@ -2183,19 +2183,17 @@
uri->fragment ? uri->fragment : "", NULL);
}
/*
- * Make sure that we pick the the correct and valid worker.
- * If a single keepalive connection triggers different workers,
- * then we have a problem (we don't select the correct one).
- * Do an expensive check in this case, where we compare the
- * the hostnames associated between the two.
+ * Figure out if our passed in proxy_conn_rec has a usable
+ * address cached.
*
- * TODO: Handle this much better...
+ * TODO: Handle this much better...
+ *
+ * XXX: If generic workers are ever address-reusable, we need
+ * to check host and port on the conn and be careful about
+ * spilling the cached addr from the worker.
*/
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) ) ) {
+ worker->disablereuse) {
if (proxyname) {
conn->hostname = apr_pstrdup(conn->pool, proxyname);
conn->port = proxyport;
----------------------
this patch seems to solve the keepalive issue on a 2.2, although i am not 100%
sure if it will break other stuff, should this patch be committed to the
2.2-branch ?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]