This is a discussion on mod_proxy_html incorrectly handles <SPAN> tag within the Windows Web Servers forums, part of the Web Server and Related Forums category; On 17 Apr 2005 17:40:42 -0700, goyald@gmail.com wrote: >I am trying mod_proxy_html to configure an ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 17 Apr 2005 17:40:42 -0700, goyald@gmail.com wrote:
>I am trying mod_proxy_html to configure an Apache reverse proxy server >on Windows platform. > >1. My test website has a very simple page > ><HTML> ><BODY> ><SPAN> SPAN TEST</SPAN> ></BODY> ></HTML> >---------------------------- >2. My httpd.conf is very simple >ProxyPass /proxyTest/ http://localhost/proxytest/ ><Location /proxyTest/> > ProxyPassReverse / > SetOutputFilter proxy-html > ProxyHTMLURLMap http://localhost/proxyTest /proxyTest ></Location> >3. Output through reverse proxy server comes out as >(Note that /SPAN tag is missing) ><HTML> ><BODY> ><SPAN> SPAN TEST ></BODY> ></HTML> > >4. If I comment out "SetOutputFilter proxy-html" in httpd.conf than >Output comes out okay (but I loose URL rewriting). > >Any suggestions will highly appreciated. Just a wild guess: Does it also fail when you include the <head></head> pair ? A proxy could try to interpret META tags within <head> to look for proxy directives, and maybe even replace them by http headers and delete the META. If such a proxy assumes <head></head> is always present it could mess up the page. HTH -- ) Kees Nuyt ( c[_] |
|
|||
|
I have actually an application on IIS 5.0 that I want to hide behind an
Apache reverse proxy on another Win2K box. I have compiled Apache build 2.0.53 with mod_proxy_html taken from apache.webthing.com. Code was compiled using MSVC 6.0. Third party softwares are - libxml2-2.6.17.win32, iconv-1.9.1.win32. While testing my original IIS 5.0 ASP application I found this SPAN related issue. Following test page placed on my internal site alo confirms this issue. If someone is interested than I can show it through webcast. ----------------- test HTML page starts here---------------- <HTML> <HEAD></HEAD> <BODY> <FORM ACTION=proxyTarget.asp METHOD=GET> This site has following structure ROOT DIRECTORY -> Include directory -> Bin directory -> CSS directory <A HREF=Include/includeTest.asp>Include/includeTest.asp</A> <BR> <A HREF=/proxyTest/Include/includeTest.asp>/proxytest/Include/includeTest.asp</A> <BR> <A HREF=http://localhost/proxyTest/Include/includeTest.asp>http://localhost/proxytest/Include/includeTest.asp</A> <BR><BR> NOW WE WILL TEST SPAN <SPAN>END OF SPAN </SPAN> BR <span> end of span </span> BR <span> end of span <!-- </span --> <FONT TYPE=arial> hhh </FONT> <INPUT TYPE=SUBMIT NAME=mode VALUE=transfer> <INPUT TYPE=SUBMIT NAME=mode VALUE=redirect> <INPUT TYPE=SUBMIT NAME=mode VALUE=aredirect> <INPUT TYPE=SUBMIT NAME=mode VALUE=atransfer> </BODY> ------------------------------- END of test ASP PAge ----------------------------- Excerpts from my httpd.conf are ------------- httpd.conf starts -------------------------- #Listen 12.34.56.78:80 Listen 8002 #................. skipping few lines to save space # DGOYAL LoadModule headers_module modules/mod_headers.so #DGOYAL #DGOYAL LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadFile modules/iconv.so LoadFile modules/libxml2.dll LoadModule proxy_html_module modules/mod_proxy_html.so #DGOYAL #........ more line skipped ............ ProxyRequests off ProxyHTMLLogVerbose on LogLevel info ProxyPass /proxyTest/ http://localhost/proxytest/ <Location /proxyTest/> ProxyPassReverse / SetOutputFilter proxy-html #ProxyHTMLURLMap / /proxytest/ ProxyHTMLURLMap http://localhost/proxyTest /proxyTest ProxyHTMLURLMap /proxyTest /proxyTest/ ProxyHTMLURLMap /proxytest /proxyTest/ </Location> ---------------------- excerpts from httpd.conf end here FYI, Output with above httpd.conf is -------------- bad output below - Notice missing SPAN tags ----------- html><head></head><body><form action="proxyTarget.asp" method="GET"> This site has following structure ROOT DIRECTORY -> Include directory -> Bin directory -> CSS directory <a href="Include/includeTest.asp">Include/includeTest.asp</a> <br> <a href="/proxyTest//Include/includeTest.asp">/proxytest/Include/includeTest.asp</a> <br> <a href="/proxyTest/Include/includeTest.asp">http://localhost/proxytest/Include/includeTest.asp</a> <br> <br> NOW WE WILL TEST SPAN <span>END OF SPAN BR <span> end of span BR <span> end of span <!-- </span --> <font type="arial"> hhh </font> <input type="SUBMIT" name="mode" value="transfer"> <input type="SUBMIT" name="mode" value="redirect"> <input type="SUBMIT" name="mode" value="aredirect"> <input type="SUBMIT" name="mode" value="atransfer"> </form></body></html> -------------------------------------------- end of output ---- output if I disable mod_proxy_html as filter. (#SetOutputFilter proxy-html - commented) ...Note that "end SPAN" TAG appears but absolute URL in href is not translated ----- <HTML> <HEAD> </HEAD> <BODY> <FORM ACTION=proxyTarget.asp METHOD=GET> This site has following structure ROOT DIRECTORY -> Include directory -> Bin directory -> CSS directory <A HREF=Include/includeTest.asp>Include/includeTest.asp</A> <BR> <A HREF=/proxyTest/Include/includeTest.asp>/proxytest/Include/includeTest.asp</A> <BR> <A HREF=http://localhost/proxyTest/Include/includeTest.asp>http://localhost/proxytest/Include/includeTest.asp</A> <BR> <BR> NOW WE WILL TEST SPAN <SPAN>END OF SPAN </SPAN> BR <span> end of span </span> BR <span> end of span <!-- </span --> <FONT TYPE=arial> hhh </FONT> <INPUT TYPE=SUBMIT NAME=mode VALUE=transfer> <INPUT TYPE=SUBMIT NAME=mode VALUE=redirect> <INPUT TYPE=SUBMIT NAME=mode VALUE=aredirect> <INPUT TYPE=SUBMIT NAME=mode VALUE=atransfer> </BODY> |
|
|||
|
Kees Nuyt wrote:
> Just a wild guess: Does it also fail when you include the > <head></head> pair ? Wrong. But if it's a pure guess, the reasoning is good. > A proxy could try to interpret META tags within <head> to look > for proxy directives, and maybe even replace them by http > headers and delete the META. That is indeed an option available to server administrators. > If such a proxy assumes <head></head> is always present It doesn't. Neither does HTML require it (though <title> is required, the parser can cope with its absence). > it could > mess up the page. FWIW, if you have libxml2 installed, you can run any HTML document through xmllint with the --html option. What comes out is the baseline for what will come out of mod_proxy_html. Any differences are changes you've configured mod_proxy_html to make. -- Nick Kew |
|
|||
|
xmllint returns correct output - So I am suspecting mod_proxy_html.
Will check more and post. C:\libxml2-2.6.17.win32\bin>xmllint --html tst.htm <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org /TR/REC-html40/loose.dtd"> <html> <head></head> <body><form action="proxyTarget.asp" method="GET"> This site has following structure ROOT DIRECTORY -> Include directory -> Bin directory -> CSS directory <a href="Include/includeTest.asp">Include/includeTest.asp</a> <br><a href="/proxyTest/Include/includeTest.asp">/proxytest/Include/incl udeTest.asp</a> <br><a href="http://localhost/proxyTest/Include/includeTest.asp">http:// localhost/proxytest/Include/includeTest.asp</a> <br><br> NOW WE WILL TEST SPAN <span>END OF SPAN </span> BR <span> end of span </span> BR <span> end of span <!-- </span --> <font type="arial"> hhh </font> <input type="SUBMIT" name="mode" value="transfer"><input type="SUBMIT" n ame="mode" value="redirect"><input type="SUBMIT" name="mode" value="aredirect">< input type="SUBMIT" name="mode" value="atransfer"></span> </form></body> </html> |