Use case: Set up a nginx reverse proxy to pass traffic to JON UI for load balancing/overcoming network restrictions. Internet -> public_ip -> nginx -> http://localhost:7080 (or private internal ip) Version-Release number of selected component (if applicable): JON3.3 How reproducible: 100% Steps to Reproduce: 0. install JON 1. install nginx 2. create the following config file in # cat /etc/nginx/conf.d/jon.conf server { listen 80; location / { proxy_pass http://localhost:7080/; } } # reload config # nginx -s reload 3. Verify JON is up @ http://<host>:7080 4. Turn on Firebugs and access JON via the proxy @ http://<host>:80 You'll get the usual error message for bad login credential. For correct credential JON seems to try to load the next page then show the login page. Firebugs log: "SEVERE: RHQ server was probably restarted. Showing the login page."
This issue happens because JON GWT client sends "RHQ_Session" http header to server to authorize itself (once it recieves value during login process). By default headers containing underscore are ignored by nginx and not bypassed to backend server. Viet, you can enable it this way: server { listen 80; underscores_in_headers on; location / { proxy_pass http://localhost:7080/; } } then you should be able to log in. Fix for this BZ is to rename RHQ_Session header to RHQ-Session, then it will work behind nginx without underscores_in_headers.
Thanks. That works! Keeping the BZ open as this tweak is worth a KB entry.
branch: master link: https://github.com/rhq-project/rhq/commit/d497b14b8 time: 2014-11-13 10:33:00 +0100 commit: d497b14b896fb2c25253f0d32a5598b5c8685046 author: Libor Zoubek - lzoubek message: Bug 1162293 - Unable to reverse proxy traffic to JON UI Got rid of _ in RHQ specific HTTP header names, so when running behind nginx, directive underscores_in_headers on; is on longer required
Cherry-picked to release/jon3.3.x: commit 48d455eb4bece45e031ff741b2484329d537679d Author: Libor Zoubek <lzoubek> Date: Thu Nov 13 10:33:00 2014 +0100 Bug 1162293 - Unable to reverse proxy traffic to JON UI Got rid of _ in RHQ specific HTTP header names, so when running behind nginx, directive underscores_in_headers on; is on longer required (cherry picked from commit d497b14b896fb2c25253f0d32a5598b5c8685046)
Moving to ON_QA as available for test with the latest 3.3.1.ER01 bits from here: http://download.devel.redhat.com/brewroot/packages/org.jboss.on-jboss-on-parent/3.3.0.GA/12/maven/org/jboss/on/jon-server-patch/3.3.0.GA/jon-server-patch-3.3.0.GA.zip
I can now log in JON via reserve proxy URL
Created attachment 984872 [details] nginx access.log