I'm on 2.8.2, using apache 2.4 mod_proxy and routes.py (mod_proxy_html 
doesn't work with urls in javascript vars). I was able to use routes.py for 
the most part but it is adding extra prefixes to the request url that I 
seem to be unable to get rid off, even though I managed to get them routed 
properly.

In httpd.conf:

...
ProxyRequests Off
RewriteEngine On
RewriteRule ^/web2py$ /web2py/ [R,L]

RewriteRule ^/web2py/(.*) http://localhost:8000/$1 [P,L]
#ProxyPass /web2py/ http://localhost:8000/
ProxyPassReverse /web2py/ http://localhost:8000/
ProxyPassReverse /web2py/ /

ProxyPassReverseCookieDomain localhost localhost
ProxyPassReverseCookiePath / /web2py/

In global routes.py:

If I only use:

routes_out=((r'^/(?P<any>.*)',r'/web2py/\g<any>'),)

Then internal links/redirections fail because it will prepend /web2py to a 
relative URL, and the next client request will be proxied to 
http://localhost:8000/web2py/...

So if we add:
routes_in = ((r'^/web2py/(?P<any>.*)', r'/\g<any>'),)

Then relative URLs will work.

However, from the point of view of apache, the client is still in 
server/web2py/ space, so the url in the browser window looks like 
https://server/web2py/web2py/app/..

Is there a way to rewrite the URL to strip the extra 'web2py' from the path 
while maintaining functionality?

-- 
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.

Reply via email to