Browser shows page source when accessing JBoss ON UI login page through reverse proxy

Solution Verified - Updated

Environment

  • Red Hat JBoss Operations Network (JON)
    • 3.3.0
    • 3.3.1
    • 3.3.2
  • Firefox or Chrome;
  • This issue does not exist when Internet Explorer (IE) is used;
  • Configured reverse proxy in front of JBoss ON by adding the following in the Apache 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>

Issue

  • I did an upgrade in our test environment from JON 3.2 to JON 3.3.1. But after the upgrade I run into a big problem. After the server "load page" is done i will come to a HTML page. It looks like JON doesn't read the HTML code and present it as it should.
  • JBoss ON 3.3 login page is loaded as a source instead of html;
  • Browser shows page source when accessing JBoss ON UI login page through reverse proxy
  • When accessing JBoss ON login page through reverse proxy, my browser shows:
<html class="login-pf" xmlns="http://www.w3.org/1999/html">
<head>
    <!-- this forces us to emulate IE8 "quirks" mode regardless of IE browser version.  It:
         1) Follows the SmartGWT recommendation of not declaring a DOCTYPE and instead using these meta elements.
            http://forums.smartclient.com/showthread.php?t=15973
         2) solves initial app load issues that we experienced on some XP and Vista/Windows7  flavors.
    -->
    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
...
<!-- GWT iframe -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

</body>
</html>
  • reverse proxy in front of jon shows html source instead of genreating the page.
  • We installed jon to listen to localhost and put a apache in front of it which acts as a reverse proxy. When we access the url we get the source code printed instead of generating the actual login page.

Resolution

This issue is under investigation and it has been captured as This content is not included.Red Hat Bugzilla 1215648. For some reason, the Content-Type of the response is set to text/plain instead of text/html.

As a workaround, adding DefaultType text/html in httpd.conf for the virtual host and restarting Apache server will force Content-Type to be set to text/html:

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

And result of the wget command will be:

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

Diagnostic Steps

Execute the following to get headers:

# wget -v -d http://jon.server.example/coregui/login

and the output of this command should be:

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

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.