https://bz.apache.org/bugzilla/show_bug.cgi?id=63176

            Bug ID: 63176
           Summary: Wrong backend is used
           Product: Apache httpd-2
           Version: 2.4.38
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Hello all,

I'm experiencing following issue. Let's create two files:

echo HIT > /var/www/html/test-hit.html
echo MISS > /var/www/html/test-miss.html


Content of /etc/httpd/conf.d/test.conf:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ProxyPass /test/ http://localhost/ 
ProxyRemoteMatch http://localhost/.*hit.html http://localhost:8080

Listen 8080

<VirtualHost *:8080>
  ProxyRequests on
  <Proxy "*">
     Require all denied
  </Proxy>
</VirtualHost>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And then start httpd. Depending on request order, I'm receiving different
content:

[root@host-8-249-187 ~]# curl http://localhost/test/test-miss.html
MISS
[root@host-8-249-187 ~]# curl http://localhost/test/test-hit.html
HIT
[root@host-8-249-187 ~]# systemctl restart httpd
[root@host-8-249-187 ~]# curl http://localhost/test/test-hit.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access http://localhost/test-hit.html
on this server.<br />
</p>
</body></html>
[root@host-8-249-187 ~]# curl http://localhost/test/test-miss.html
MISS


I debugged it a bit and depending on request order, in
ap_proxy_acquire_connection, function apr_reslist_acquire acquiring different
values.

Correct case:

(gdb)                                                                           
2292        if (worker->s->hmax && worker->cp->res) {                           
2293            rv = apr_reslist_acquire(worker->cp->res, (void **)conn);       
2294        }    
(gdb) p **conn
$10 = {connection = 0x0, r = 0x0, worker = 0x55555586df58, pool =
0x55555594cb78,
  hostname = 0x0, addr = 0x0, scpool = 0x7fffb8007018, sock = 0x0, data = 0x0,
  forward = 0x0, flags = 0, port = 0, is_ssl = 0, close = 0, need_flush = 0,
  inreslist = 1, uds_path = 0x0, ssl_hostname = 0x0, tmp_bb = 0x0}

Whereas in wrong case:

(gdb) p **conn                                                                  
$9 = {connection = 0x7fffb80072e0, r = 0x0, worker = 0x55555586df58,            
  pool = 0x55555594cb78, hostname = 0x55555594cc60 "localhost",                 
  addr = 0x5555558e47c0, scpool = 0x7fffb8007018, sock = 0x7fffb8007090, data =
0x0,                                                                            
  forward = 0x0, flags = 0, port = 80, is_ssl = 0, close = 0, need_flush = 0,   
  inreslist = 1, uds_path = 0x0, ssl_hostname = 0x0, tmp_bb = 0x7fffb80072a0}   


Also found out, that this was working in 2.4.34 and stopped to work in 2.4.37.

-- 
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]

Reply via email to