简体   繁体   中英

Apache stripping comments from html

I have a deployment where Apache forwards to Tomcat running on the same system. I'm running into a situation where Apache is stripping out comments in html returned by Tomcat. This is causing lines like the following to be removed causing the js to fail on IE:

"<!--if IE><script language="javascript" type="text/javascript" src="/scripts/excanvas.js"></script><!endif>"

I have mod_rewrite, mod_proxyhtml and of course proxy_ajp. I tried adding "ProxyHTMLStripComments Off" but that doesn't seem to help.

What am I missing ?

I know that your question is ancient, but for the people who are struggling with this issue i have the following solution:

Apache proxy html rewrites html following the guidelines specified by the html standard you are using. If you are using your proxy for a modern site i suggest you specify the Doctype by adding ProxyHTMLDocType "<!DOCTYPE html>"

This will ensure that your html is rewritten accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM