Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1314335

Summary: Proxypass directives inside a virtualhost definition do not use balancers parameters if the balancer definition is outside the virtualhost definition
Product: Red Hat Enterprise Linux 7 Reporter: roidelapluie
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED NEXTRELEASE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.2CC: jkaluza, jorton, roidelapluie
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-16 13:59:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.