mod_proxy(_html) and a buggy Webserver

Alles, was den Apache betrifft, kann hier besprochen werden.

mod_proxy(_html) and a buggy Webserver

Postby baldrian » 03. September 2015 12:18

Hi all,

we've got a Webserver that answers to AJAX requests by sending JSON Data to the client. Problem is that the JSON Data has the content-type "text/html" instead of "application/json" (FYI its an Oracle APEX Server, the bug is aknowledged by Oracle but they wont fix it).
Between the clients and the server is an Apache Webserver configured as a SSL-Proxy.
That Proxy will now scan every "text/html" Data transmitted from the Server to the client, rewrite links if nessesary and, unfortunately, will also fix "malformed" html data. since the JSON Data sent from the server is labeled as text/html, those html fixes are also applied to the JSON Data (<html><body>.. tags will be added for example), which renders it unusable by the requesting client (parse errors).

what i tried up to now
- /apex/ is the function delivering JSON Data. I'd like that to be proxied without any rewriting, while the rest of /apex/ should be proxied "the normal way".
- i'e added "Header set X-Rule-..." just to trace which <Location> Rule is applied
Code: Select all
 <Location "/apex/">
   Header set "" "1"
   Header set Content-Type "application/json"
 <Location /apex/>
   Header set "X-Rule-apex" "1"
   Header always set Cache-Control "no-cache, no-store, max-age=0, must-revalidate" env=nocache
   SetOutputFilter INFLATE;proxy-html;DEFLATE
   RequestHeader unset Accept-Encoding
   ProxyPassReverse /apex/
   ProxyHTMLURLMap /       /apex/
   ProxyHTMLURLMap /apex  /apex
   ProxyHTMLURLMap /apex/ /apex/
   ProxyHTMLDocType '<!DOCTYPE html>'

As a result i get the JSON Data now labeled as "application/json", but also HTML-Filtered with the "<html><body>..." tags.
In addition both "X-Rule…" Headers ("X-Rule-apex" and "") are set in the arriving Data Package
which means that both <Location> Rules were applied.

- Is there any way to tell mod_proxy only to apply <Location "/apex/"> if it fits and then stop?
- is it possible to deactivate the fixing of "malformed" html data (globally)? didnt find anything :/
- Is i possible to tell <Location /apex/> to stop procesing if the url contains ""? also didnt find anyhing.
- Or is there any other option i cant think of to solve the problem?
Posts: 1
Joined: 03. September 2015 10:48
Operating System: linux, windows, solaris 10/11

Return to Apache

Who is online

Users browsing this forum: No registered users and 6 guests