Currently I am developping an application using Oracle Application Express (APEX) with Apache as reverse proxy/SSL offloader. Suddenly the application started to misbehave and instead of the rendered page the browser would show the HTML code including HTTP headers. It would happen for around 10% of the called pages and clearly needed to be addressed.
As I said the browser would not render the page but instead show HTML. The text also started with the HTTP headers generated by Oracle. Here is an excerpt of the output I got:
0
HTTP/1.1 200 OK
Server: Oracle XML DB/Oracle Database
Content-Type: text/html; charset=UTF-8
X-DB-Content-length: 24556
Transfer-Encoding: chunked
6007
<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com"><head><link rel="stylesheet" href="/i/themes/theme_13/theme_4_0.css" type="text/css" />...
At first I suspected that Apache was adding a text/plain content type to the output. I added DefaultType None to the configuration but that did not solve the problem.
The following thread gave the correct hint to finally solve the issue:
http://forums.oracle.com/forums/thread.jspa?threadID=938645.
Looking at the reportedly working configuration I found out that adding the following two options to the mod_proxy configuration did indeed solve the issue for me:
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
Using R to visualize Oracle metrics
Another PL/SQL password generator
Oracle and Foreign Keys without Index