Accessing an oracle apex server via an apache proxy, I sporadically get the following HTTP Package as a response from the server:
Connection:Keep-Alive
Date:Fri, 20 Jan 2017 16:00:24 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.4.6 () PHP/5.4.16
Transfer-Encoding:chunked
0
HTTP/1.1 200 OK
Server: Oracle XML DB/Oracle Database
Content-Type: text/html; charset=utf-8
Content-Length: 33388
ACTUAL HTML PAGE FROM APEX
I don't know where the 0 comes from. Though it seems that the Proxy wraps the complete HTTP response it gets from APEX (including the HTTP header) as a HTTP body into another HTTP package:
<Apache HTTP PACKAGE>
<Apache HTTP HEADER>
Connection:Keep-Alive
Date:Fri, 20 Jan 2017 16:00:24 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.4.6 () PHP/5.4.16
Transfer-Encoding:chunked
</Apache HTTP HEADER>
<Apache HTTP BODY>
0
<APEX HTTP PACKAGE>
HTTP/1.1 200 OK
Server: Oracle XML DB/Oracle Database
Content-Type: text/html; charset=utf-8
Content-Length: 33388
ACTUAL HTML PAGE FROM APEX
</APEX HTTP PACKAGE>
</Apache HTTP BODY>
</Apache HTTP PACKAGE>
Instead, the proxy should simply forward the HTTP Package to the client. So that the client receives the HTTP Package as if it comes from APEX without being aware that it was forwarded by the Proxy. This works as expected 29 out of 30 times, but sometimes it behaves as described above. Is this a Bug in the Proxy? Could you please suggest a possible workaround?
This is not a wrapping, it is due to the
transfer-encoding: chunked
header. See https://en.wikipedia.org/wiki/Chunked_transfer_encodingThe 0 is the signal of the final chunk. From the above page:
and
Try
SetEnv proxy-nokeepalive 1
in your Apache mod_proxy configuration. Or trySetEnv proxy-sendcl 1
SetEnv proxy-sendchunked 0
See http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#request-bodies for explanations.