Jorge Godoy wrote:
Just out of curiosity, how easy it is to set it up to be a "proxy" for a
normal HTTP website running on Zope (with rewrite rules on Apache) and for a
secure HTTPS website running on TG (also with rewrite rules on Apache)?
Apache is receiving the SSL connection, dealing with it and then proxying with
a plain HTTP connection inside the server.
I've found the Lighttpd proxy support to be less than stellar, mostly because it isn't (yet) a reverse proxy. I use Pound (http://www.apsis.ch/pound/) as my reverse proxy. The mod_rewrite in Lighttpd is great. It doesn't support things like RewriteCond, but I've found that, for the few sites I used RewriteCond with, I was able to write the rules a bit differently and achieve the same effect (and also by using the 404 handler in some cases, notably Mambo). I've also learned since then that I'd rather the app handle the url mapping than the webserver, but that's a different point altogether ;-)

This is the rule for the Zope website:

    RewriteEngine On
    RewriteRule ^/(.*) 
http://localhost:8088/VirtualHostBase/http/something.my.server.com:80/Godoy/VirtualHostRoot/$1
 [L,P]


What I would do is this:

In /etc/pound/pound.conf:

ListenHTTP 1.2.3.4,80
ListenHTTPS 1.2.3.4,443  /etc/pound/certs/turbogears.server.pem

UrlGroup ".*"
HeadRequire Host ".*zope.server.com.*"
BackEnd 127.0.0.1,8088,1
EndGroup

UrlGroup ".*"
HeadRequire Host ".*turbogears.server.com.*"
BackEnd 127.0.0.1,8080,1
EndGroup

That takes care of proxying back to those ports (and handling the SSL of course). I'm not really following the Zope virtual hosting bit, but the general pattern for Lighttpd rewrite rules is this:


url.rewrite = (
 "^/(.*)" => "/elsewhere/$1"
)

I'm not entirely convinced you'd need rewrite rules or even an additional webserver (unless you are using it to serve static files). Pound was originally developed as a Zope proxy and load balancer and includes specific instructions on getting it set up.

I'm running TG directly behind Pound at the moment and have been running around 30 sites on Pound + Lighttpd happily for several months now.

Regards,
Cliff


Reply via email to