Bug 1215657 - Reverse proxy in front of RHQ does not render the login page but shows the html source of the page
Summary: Reverse proxy in front of RHQ does not render the login page but shows the ht...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Core UI
Version: 4.12
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1215648
TreeView+ depends on / blocked
 
Reported: 2015-04-27 11:47 UTC by bkramer
Modified: 2022-03-31 04:28 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description bkramer 2015-04-27 11:47:07 UTC
Description of problem:

Reverse proxy in front of RHQ does not render the login page but shows the html source of the page

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

How reproducible:
Always

Steps to Reproduce:
1. install and configure RHQ 4.12
2. install Apache httpd server and configure virtual host in the httpd.conf file:
******************************
<VirtualHost jon.server.example:80>

ServerName jon.server.example

ProxyRequests Off
ProxyPreserveHost On

ProxyPass        /  http://jon.server.example:7080/
ProxyPassReverse /  http://jon.server.example:7080/

</VirtualHost>
******************************
3. restart the Apache server;
4. navigate to http://jon.server.example/coregui/login

Actual results:
Browser will present the source of the page


Expected results:
Browser properly renders the login page and we have login username/password fields presented.

Additional info:
For some reason, when going through reverse proxy, response Content-Type is set to "text/plain" instead of expected "text/html". 

If we run wget command the following is got:

************************************************
# wget -v -d http://jon.server.example/coregui/login
DEBUG output created by Wget 1.12 on linux-gnu.

--2015-04-27 11:37:31--  http://jon.server.example/coregui/login
Resolving jon.server.example... 10.33.1.53
Caching jon.server.example => 10.33.1.53
Connecting to jon.server.example|10.33.1.53|:80... connected.
Created socket 3.
Releasing 0x00000000015387e0 (new refcount 1).

---request begin---
GET /coregui/login HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: jon.server.example
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 200 OK
Date: Mon, 27 Apr 2015 10:37:31 GMT
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"5265-1423819844000"
Last-Modified: Fri, 13 Feb 2015 09:30:44 GMT
Content-Length: 5265
Connection: close
Content-Type: text/plain; charset=UTF-8

---response end---
200 OK
Length: 5265 (5.1K) [text/plain]
Saving to: `login'

100%[====================================================================================================================================================================================================>] 5,265       --.-K/s   in 0s      

Closed fd 3
2015-04-27 11:37:31 (278 MB/s) - `login' saved [5265/5265]
************************************************


However, setting DefaultType to text/html for virtual host [1] seems to make a difference as wget command will return:

************************************************
# wget -v -d http://jon.server.example/coregui/login
DEBUG output created by Wget 1.12 on linux-gnu.

--2015-04-27 11:43:58--  http://jon.server.example/coregui/login
Resolving jon.server.example... 10.33.1.53
Caching jon.server.example => 10.33.1.53
Connecting to jon.server.example|10.33.1.53|:80... connected.
Created socket 3.
Releasing 0x00000000020dc700 (new refcount 1).

---request begin---
GET /coregui/login HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: */*
Host: jon.server.example
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 200 OK
Date: Mon, 27 Apr 2015 10:43:58 GMT
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
ETag: W/"5265-1423819844000"
Last-Modified: Fri, 13 Feb 2015 09:30:44 GMT
Content-Length: 5265
Connection: close
Content-Type: text/html; charset=UTF-8

---response end---
200 OK
Length: 5265 (5.1K) [text/html]
Saving to: `login.1'

100%[====================================================================================================================================================================================================>] 5,265       --.-K/s   in 0s      

Closed fd 3
2015-04-27 11:43:58 (203 MB/s) - `login.1' saved [5265/5265]
************************************************



[1] New configuration for virtual host:
************************************************
<VirtualHost jon.server.example:80>

ServerName jon.server.example

ProxyRequests Off
ProxyPreserveHost On

DefaultType text/html

ProxyPass        /  http://jon.server.example:7080/
ProxyPassReverse /  http://jon.server.example:7080/

</VirtualHost>
************************************************


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