lighttpd forum lighty > Lighttpd and proxy limitations (Zope / Plone)

Posted by Jaroslaw Zabiello
on 03.02.2006 16:42
I would like to migrate from Apache 2 to Lighttpd but I was hit by the
problem I cannot solve. I am using few Plone sites...

What I need is to create proxy from http://myhost to
http://myhost:8000/plone. In Apache it is very easy. I can do:

for vhost1:
RewriteRule ^/(.*) http://vhost1:8000/plone1/$1 [P,L]

for vhost2:
RewriteRule ^/(.*) http://vhost2:8000/plone2/$1 [P,L]


Is it possible for lighttpd? I have lost few hours and all in vain. :(
Posted by Adam Host
on 04.02.2006 03:57
have you tried this recipe ?
http://www.lighttpd.net/documentation/proxy.html

"proxy limitations" ? I don't see anything 'special'
in your Apache example, so where is the problem ?

Cheers,
Adam
Posted by Ron Bickers
on 04.02.2006 06:58
I'm not using Plone, but I do have a dozen or so Zope sites going 
through lighttpd.  Here's my proxy setup:

url.rewrite-once = ( "^/(.*)$" => 
"/VirtualHostBase/http/www.example.com:80/example/VirtualHostRoot/$1" )
proxy.server = ( "/VirtualHostBase/" => ( ( "host" => "127.0.0.1" , 
"port" => 8000 ) ) )

This makes use of Zope's Virtual Host Monster object that should be in 
your root folder.  I specify a proxy prefix because some of my hosts 
exclude certain paths from the proxy.  For example:

url.rewrite-once = (
    "^/misc/.*" => "$0",
    "^/(.*)$" => 
"/VirtualHostBase/http/www.example.com:80/example/VirtualHostRoot/$1" )

So, URLs like http://www.example.com/misc/otherpage.html will be served 
from the file system; everything else goes to Zope.

Hope this helps.
Posted by Ron Bickers
on 04.02.2006 07:01
Adam Host wrote:
> have you tried this recipe ?
> http://www.lighttpd.net/documentation/proxy.html
> 
> "proxy limitations" ? I don't see anything 'special'
> in your Apache example, so where is the problem ?

The special part is the "plone1" and "plone2" path that needs to be in 
the URL passed to the Zope server, but is not part of the requested URL. 
You have to use url.rewrite and proxy.server together to get this 
behavior.
Posted by Jaroslaw Zabiello (Guest)
on 05.02.2006 02:33
Ron Bickers wrote:
[...]
> Hope this helps.

Works perfect! Tnx.
Posted by Edward Muller
on 18.04.2007 21:11
With this or similar setups I can't get standard zope /manage pages to 
work? It looks like lighty is swallowing the unauthorized response. 
Cookie based authentication works, but I'd rather not have to use that 
for /manage urls.

Ron Bickers wrote:
> I'm not using Plone, but I do have a dozen or so Zope sites going 
> through lighttpd.  Here's my proxy setup:
> 
> url.rewrite-once = ( "^/(.*)$" => 
> "/VirtualHostBase/http/www.example.com:80/example/VirtualHostRoot/$1" )
> proxy.server = ( "/VirtualHostBase/" => ( ( "host" => "127.0.0.1" , 
> "port" => 8000 ) ) )
> 
> This makes use of Zope's Virtual Host Monster object that should be in 
> your root folder.  I specify a proxy prefix because some of my hosts 
> exclude certain paths from the proxy.  For example:
> 
> url.rewrite-once = (
>     "^/misc/.*" => "$0",
>     "^/(.*)$" => 
> "/VirtualHostBase/http/www.example.com:80/example/VirtualHostRoot/$1" )
> 
> So, URLs like http://www.example.com/misc/otherpage.html will be served 
> from the file system; everything else goes to Zope.
> 
> Hope this helps.
Posted by Goran Mekić
on 20.05.2007 20:24
Is there a way to ... hm ... I don't know how to call it ... 
back-rewrite urls? For example, if you visit 
http://sparrow.ns-linux.org/ you get the plone page from 
http://sparrow.ns-linux.org:8080/lugons. Now, take a look at the links. 
Every link on the page is 
http://sparrow.ns-linux.org/lugons/<something>. In some cases (Zope 
Management Interface, especially) I get /lugons repeating for few times. 
Is there a way to avoid this?

PS. I'm not experienced lighttpd user, so it may be my config's fault.
Posted by Jim (Guest)
on 11.08.2008 13:14
Goran Mekić wrote:
> Is there a way to ... hm ... I don't know how to call it ... 
> back-rewrite urls? For example, if you visit 
> http://sparrow.ns-linux.org/ you get the plone page from 
> http://sparrow.ns-linux.org:8080/lugons. Now, take a look at the links. 
> Every link on the page is 
> http://sparrow.ns-linux.org/lugons/<something>. In some cases (Zope 
> Management Interface, especially) I get /lugons repeating for few times. 
> Is there a way to avoid this?

That's supposed to be what the Virtual Host Monster does for you in the 
above example... (There's a recent alternative to the VirtualHostMonster 
available, I forget what the name of it is.)
Posted by Diggo (Guest)
on 29.10.2008 06:55
Thanks a lot, dude :)
Posted by Diggo (Guest)
on 29.10.2008 07:00
Thanks a lot, dude :)
Posted by Diggo (Guest)
on 29.10.2008 07:06
Thanks a lot, dude :)
Posted by Diggo (Guest)
on 29.10.2008 07:12
Thanks a lot, dude :)
Posted by Diggo (Guest)
on 29.10.2008 07:19
Thanks a lot, dude :)
Posted by Diggo (Guest)
on 29.10.2008 07:24
Thanks a lot, dude :)