I've just updated to nevow 0.4.1 and I enjoy the improvements, especially on the LivePage API. But i've found something that doesn't work for me in the new way to render livepage "glue" : the render_liveglue method uses the url.here() function, and as I'm using an Apache proxy to access the site it gives me "http://localhost:8080[...]" instead of the URL I'm accessing. For now I've set manually the liveglue.js in my header, and I think it's a clean way to do it, but I was wondering if there was a another way to get "good" URL (which means the one the browser see). Anyway thanks for that great work ! -- Thomas HERVE ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Thomas HERVE wrote:
I've just updated to nevow 0.4.1 and I enjoy the improvements, especially on the LivePage API. But i've found something that doesn't work for me in the new way to render livepage "glue" : the render_liveglue method uses the url.here() function, and as I'm using an Apache proxy to access the site it gives me "http://localhost:8080[...]" instead of the URL I'm accessing.
For now I've set manually the liveglue.js in my header, and I think it's a clean way to do it, but I was wondering if there was a another way to get "good" URL (which means the one the browser see).
Anyway thanks for that great work !
This is a common problem with proxied applications. It affects anything that generates URLs. You need to add a nevow.vhost.VHostMonsterResource to your site. See the docstring for details, including how to configure the Apache proxy. Cheers, Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer.
Quoting Matt Goodall <matt@pollenation.net>:
This is a common problem with proxied applications. It affects anything that generates URLs.
You need to add a nevow.vhost.VHostMonsterResource to your site. See the docstring for details, including how to configure the Apache proxy.
Well in fact I use a resource wrapped in a guard.SessionWrapper to get the authentication functionnality, and the only solution I've seen for using vhosts is the small hack found here : http://twistedmatrix.com/pipermail/twisted-web/2004-October/000801.html. There's not seem to have a clean solution for this problem, and I'm not (yet :)) able to judge if I should use this. -- Thomas
Quoting Thomas HERVE <therve@free.fr>:
Quoting Matt Goodall <matt@pollenation.net>:
You need to add a nevow.vhost.VHostMonsterResource to your site. See the docstring for details, including how to configure the Apache proxy.
Well in fact I use a resource wrapped in a guard.SessionWrapper to get the authentication functionnality, and the only solution I've seen for using vhosts is the small hack found here : http://twistedmatrix.com/pipermail/twisted-web/2004-October/000801.html. There's not seem to have a clean solution for this problem, and I'm not (yet :)) able to judge if I should use this.
As always, it's faster to talk than it is to search, and I found a solution in svn sandbox, in tv/monsterguard. It "simply" uses an intermediate root page to declare the VHostMonster. I looks like this : In apache configuration : ProxyPass /app http://localhost:8080/vhost/http/www.example.com/app In tac file : # Start code realm = mysite.MyRealm() portal = portal.Portal(realm) portal.registerChecker(checkers.AllowAnonymousAccess(), credentials.IAnonymous) portal.registerChecker(mysite.MyCredChecker()) // Create a small static page, should not be accessed root = static.Data('This is the private server, not accessible from the Internet. It hosts <a href="app/">app</a>', 'text/html') root.putChild('', root) root.putChild('vhost', vhost.VHostMonsterResource()) root.putChild('app', guard.SessionWrapper(portal, mindFactory=livepage.LivePage)) // MySite is an appserver.Site site = mysite.MySite(root) application = service.Application("mysite") internet.TCPServer(8080, site).setServiceParent(application) # END Code Et voila. -- Thomas
participants (2)
-
Matt Goodall
-
Thomas HERVE