Also, note that if you call redirect(..., client_side=True), web2py will send the redirect URL in a special "web2py-redirect-location" HTTP header, which will be read by the JS code in web2py.js. Also, when web2py makes an Ajax call to load a component, it passes the URL of the parent page in a special "web2py-component-location" HTTP header, which can be accessed on the server in request.env.http_web2py_component_location. I'm not sure how you might get those URL's re-written. For the client-side redirect, you might need to manually do the re-writing in your app code. Regarding web2py-component-location, that probably isn't used too often anyway.
Anthony On Friday, November 15, 2013 10:54:30 AM UTC-5, DeanK wrote: > > Awesome. I was trying to use mod_substitute to replace the url in the > data tag but things weren't loading right. Anthony's suggestions worked. > I'm going to do some more extensive testing, but at first glance it looks > like that did the trick. Thanks! > > > > On Friday, November 15, 2013 10:44:34 AM UTC-5, Anthony wrote: >> >> Does it work if you add the following to your proxy_html.conf file: >> >> ProxyHTMLLinks div data-w2p_remote >> >> >> See >> http://httpd.apache.org/docs/current/mod/mod_proxy_html.html#proxyhtmllinks >> and >> http://apache.webthing.com/svn/apache/filters/proxy_html/proxy_html.conf. >> >> Anthony >> >> On Thursday, November 14, 2013 6:46:42 PM UTC-5, DeanK wrote: >>> >>> I'm having trouble with a web2py site sitting behind an Apache2 reverse >>> proxy that uses web2py's built in ajax capability. The main domain server >>> configuration is setup like this to point to the server running my web2py >>> app: >>> >>> ProxyHTMLInterp On >>> LogLevel Debug >>> ProxyHTMLLogVerbose On >>> ProxyPass /link/ http://my.server.com/ >>> ProxyPassReverse /link/ http://my.server.com/ >>> >>> ProxyHTMLURLMap http://my.server.com /link/ >>> >>> <Location /stem/> >>> ProxyPassReverse / >>> SetOutputFilter proxy-html >>> ProxyHTMLURLMap http://my.server.com /link/ >>> ProxyHTMLURLMap / /link/ >>> ProxyHTMLURLMap /link/ /link/ >>> RequestHeader unset Accept-Encoding >>> </Location> >>> >>> So now if I go to http://maindomain.com/link/ it loads my web2py app >>> from http://my.server.com >>> >>> With this configuration things more or less appear to work for http >>> right now (i still need to sort out https). The only issue is all of my >>> ajax calls that use web2py's built in LOAD() function break. I'm thinking >>> this is because proxy_html doesn't recognize the ajax call in the html to >>> rewrite it due to how web2py does things? >>> >>> view snippet: >>> .... >>> >>> <div id="project1">{{=LOAD('project','project_grid.load', >>> ajax=True,ajax_trap=True,user_signature=True,target="project1")}}</div> >>> >>> .... >>> >>> >>> html after proxy: >>> ... >>> >>> <div id="project1"><div data-w2p_remote=" >>> /myapp/project/project_grid.load?_signature=f9f89cf781972e66ed34841f00c3250686653cbc" >>> >>> id="project1">loading...</div></div> >>> >>> ... >>> >>> >>> here if the url rewrite worked this should have pointed to >>> /link/myapp/project/project_grid.load >>> >>> >>> >>> Anyone have any experience with this? Is there somehow i can tell >>> web2py to add the prefix for only the LOAD() methods or something? Thanks. >>> >>> >>> >>> >>> >>> >>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.