jquery - Ajax form attributes are removed when accessing application through reverse proxy -
i have vb.net mvc 4 application functions correctly locally , on server. using apache reverse proxy provide access of our applications, , when implemented this, form attributes generated via ajaxoptions removed.
in example:
<% using (ajax.beginform("getadminsearchresults", "initiationsearchresults", new ajaxoptions {.httpmethod = "post", .onsuccess = "updateplaceholder", .updatetargetid = "lstsearchresults"}, new {.id = "frmsearch"}))%>
without reverse proxy, html generated is:
<form action="/initiationsearchresults/getadminsearchresults?length=23" data-ajax="true" data-ajax-method="post" data-ajax-mode="replace" data-ajax-success="updateplaceholder" data-ajax-update="#lstsearchresults" id="frmsearch" method="post">
but reverse proxy:
<form action="/initiationsearchresults/getadminsearchresults?length=23" id="frmsearch" method="post">
this of course causes view return data full page rather target div. if form tag hard-coded on view, reverse proxy ends removing data-ajax attributes. way i've been able attributes remain setting them via jquery after page loaded. i've been scouring internet , have had 0 success in figuring out why happening. assistance in appreciated. perhaps setting needs changed or added reverse proxy configuration?
loadmodule proxy_module /usr/lib/apache2-prefork/mod_proxy.so loadmodule proxy_http_module /usr/lib/apache2-prefork/mod_proxy_http.so loadmodule proxy_html_module /usr/lib/apache2/mod_proxy_html.so loadmodule rewrite_module /usr/lib/apache2/mod_rewrite.so loadmodule headers_module /usr/lib/apache2-prefork/mod_headers.so loadmodule substitute_module /usr/lib/apache2/mod_substitute.so loadmodule proxy_balancer_module /usr/lib/apache2/mod_proxy_balancer.so namevirtualhost 10.125.186.140:443 namevirtualhost 10.125.186.140:80 <virtualhost 10.125.186.140:443> errordocument 404 /unknown.html sslengine on sslcertificatefile /cert/wildcard.crt sslcertificatekeyfile /cert/wildcard.key sslcertificatechainfile /cert/lawson_root.crt sslcertificatechainfile /cert/entrust_l1e_chain_bundle.crt servername qa-initiation.company.com sslproxyengine on proxyreceivebuffersize 4096 proxyrequests off proxyhtmllinks href proxyhtmllinks area href proxyhtmllinks link href proxyhtmllinks img src longdesc usemap proxyhtmllinks object classid codebase data usemap proxyhtmllinks q cite proxyhtmllinks blockquote cite proxyhtmllinks ins cite proxyhtmllinks del cite proxyhtmllinks form action proxyhtmllinks input src usemap proxyhtmllinks head profile proxyhtmllinks base href proxyhtmllinks script src proxyhtmlevents onclick ondblclick onmousedown onmouseup \ onmouseover onmousemove onmouseout onkeypress \ onkeydown onkeyup onfocus onblur onload \ onunload onsubmit onreset onselect onchange proxyhtmldoctype html proxyhtmlenable on proxyhtmlextended on header add access-control-allow-origin https://qa-oe.company.com proxypassmatch (?i)^/(.*) https://onlineinit.companyqa.local/ proxypass / https://onlineinit.companyqa.local/ proxypassreverse / https://onlineinit.companyqa.local/ proxyhtmlurlmap https://www.companyqa.local https://qa-oe.company.com l </virtualhost>
sorry doesn't solve problem might useful.
apache's mod_proxy_html rewrites html , strips attributes doesn't recognize. example,
<p style="color:white;" test="test"></p>
translates into
<p style="color:white;"></p>
after passes through reverse proxy. reverse proxy adds doctype, , wraps content in html , body tags, if not present.
i haven't found way avoid except turning off html rewriting on file/folder. did turn off pages breaking, , used relative links in pages:
<location /path/to/badly/rewriten/stuff/> setoutputfilter none </location>
if there better way this, i'd know too!
Comments
Post a Comment