Bug 1314335 - Proxypass directives inside a virtualhost definition do not use balancers parameters if the balancer definition is outside the virtualhost definition
Summary: Proxypass directives inside a virtualhost definition do not use balancers par...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: httpd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-03 12:27 UTC by roidelapluie
Modified: 2020-01-16 13:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-16 13:59:40 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description roidelapluie 2016-03-03 12:27:46 UTC
Description of problem:

When I set up a balancing reverse proxy with sticky sessions, the Proxy definitions need to be inside the virtualhost definition, otherwise the balancers parameters do not work.


Version-Release number of selected component (if applicable):

httpd-2.4.6-40.el7.x86_64

How reproducible:
All the time

Steps to Reproduce:
1. Create a balancer and vhost in /etc/httpd/conf.d/balancer.conf

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"\n- BALANCER_SESSION_STICKY: \"%{BALANCER_SESSION_STICKY}e\"\n- BALANCER_SESSION_ROUTE: \"%{BALANCER_SESSION_ROUTE}e\"\n- BALANCER_WORKER_ROUTE: \"%{BALANCER_WORKER_ROUTE}e\"\n- BALANCER_ROUTE_CHANGED: %{BALANCER_ROUTE_CHANGED}e\n- Set-Cookie: %{Set-Cookie}o\n- JSESSIONID cookie: %{JSESSIONID}C" DebugBalancer

<VirtualHost 0.0.0.0:80>
  ServerName test
  DocumentRoot "/var/www/html"
  <Directory "/var/www/html">
    AllowOverride None
    Require all granted
  </Directory>
  ErrorLog "/var/log/httpd/test_nossl_error.log"
  LogLevel debug
  ServerSignature Off
  CustomLog "/var/log/httpd/test_nossl_access.log" "DebugBalancer" 
  ProxyRequests Off
  ProxyPreserveHost Off
  ProxyPass /test balancer://test-nbi/test scolonpathdelim=On stickysession=JSESSIONID|JSESSIONID
  ProxyPassReverse /test http://10.60.0.111:8082/test
  ProxyPassReverse /test http://10.60.0.112:8182/test
  ProxyPassReverse /test http://10.60.0.113:8282/test
</VirtualHost>
<Proxy balancer://test-nbi>
 BalancerMember http://10.60.0.111:8082 route=fna080-test-interface-1
 BalancerMember http://10.60.0.113:8282 route=fna080-test-interface-3
 BalancerMember http://10.60.0.112:8182 route=fna080-test-interface-2
</Proxy>


2. Put something behind 10.60.0.112:8182 10.60.0.113:8282 10.60.0.111:8082 which sets a JSESSIONID cookie
3. Open the browser to the virtualhost, refresh multiple time

Actual results:

In the logs:
10.110.254.5 - - [03/Mar/2016:11:09:40 +0100] "GET /test/login HTTP/1.1" 200 20836 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0"
- BALANCER_SESSION_STICKY: "-"
- BALANCER_SESSION_ROUTE: "-"
- BALANCER_WORKER_ROUTE: "fna080-test-interface-1"
- BALANCER_ROUTE_CHANGED: -
- Set-Cookie: JSESSIONID=fna080-test-interface-1xsvguy6feu0h1imfs0k1ap6bb.fna080-test-interface-1;Path=/
- JSESSIONID cookie: fna080-test-interface-32muoaee8ywiw18dlwwi4o117w.fna080-test-interface-3


In the browser:
The requests are not served by the same backend

Expected results:

In the logs:
10.110.254.5 - - [03/Mar/2016:11:10:24 +0100] "POST /test/login" 200 21016 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0"
- BALANCER_SESSION_STICKY: "JSESSIONID"
- BALANCER_SESSION_ROUTE: "fna080-test-interface-3"
- BALANCER_WORKER_ROUTE: "fna080-test-interface-3"
- BALANCER_ROUTE_CHANGED: -
- Set-Cookie: -
- JSESSIONID cookie: fna080-test-interface-3x57xw5y2jqas1am4662xfxrbk.fna080-test-interface-3

In the browser:
The requests are served by the same backend

Additional info:

Puttinq the <Proxy> block inside the <Virtualhost> block fixes the problem. However if this would be a configuration error from my side, I expect the virtualhost not to be able to use the balancer at all, instead of being able to use it but not able to set parameters.

Comment 3 Joe Orton 2017-02-07 09:58:03 UTC
Thank you for taking the time to report this issue to us. We appreciate the feedback and use reports such as this one to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to guarantee the timeliness or suitability of a resolution.

If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution. 

For information on how to contact the Red Hat production support team, please visit:
https://access.redhat.com/support/contact/technicalSupport/

Comment 5 roidelapluie 2017-02-07 19:14:46 UTC
Hi Joe, I was not requesting support, just reporting a bug. That said, we have RH support. It was not needed here because as specified in my comment we have a workaround.

Comment 10 Joe Orton 2020-01-16 13:59:40 UTC
The likely fix was merged for this upstream and it should work as you expect in RHEL 8.


Note You need to log in before you can comment on or make changes to this bug.