Forum

Reverse proxy feature

Karsten
5 September 2009, 18:00
Hello,

The Hiawatha server is really nice, especially the configuration file. But does Hiawatha support a reverse proxy feature? I couldn't find any.

Like lighttpd

proxy.server = ( ".extension" =>
( (
"host" => "10.0.0.242",
"port" => 81
) )
)

Or nginx:

location /url/ {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr; <- Really cool.
}

Do you have plans to implement this feature? This would be the icing on the cake.

Karsten

Hiawatha version: v6.17.1
Operating System: Debian 5.0
Hugo Leisink
5 September 2009, 19:53
A webserver is not a proxy server. So, I have no intention to implement proxy functionality in my webserver. I see no reason. But maybe you can convince me why a webserver should have proxy functionality. What kind of weird web applications need that kind of functionality?
Karsten
5 September 2009, 20:48
Thanks for your answer. For example: I have a Python based application server that listens to port 8000 and provides several applications, http://server_ip/myapp:8000, http://server_ip/yourapp:8000 and so on. To hide the applications behind a web server, i need either WSGI support (which is neatly implemented in Apache) or simply a reverse proxy server (poor man's method, but very efficient). In this respect lighttpd or nginx work perfectly and only need a simple configuration directive (see above). On top of that i have full control over the applications i want to expose to the internet. I agree that a web server is no replacement for a proxy server like Squid or similar but at HTTP level i see a lot of demand for this feature. I hope I'm not alone.
Hugo Leisink
6 September 2009, 09:28
Let me get this straight. You Python application listens to port 8000 and works when requests are proxied to that port. Which means that your Python application works as a.... webserver?
Karsten
6 September 2009, 13:46
That's true. It has a built-in web server but unfortunately with poor SSL support. At the moment i use Hiawatha's UrlToolkit with a redirect rule which is ok for my current purposes but not in the long term.

A second example: One of my customers uses Microsoft Exchange Server behind a firewall with Apache and mod_proxy in the DMZ. So employees can access their mailboxes via Internet and mobile phone without exposing the Exchange Server to world. Hiawatha would be perfect for this job because of it's small footprint.
Hugo Leisink
6 September 2009, 23:05
Instead of having a webserver with proxy functionality, you should use a reverse proxy which redirects incoming requests to your Python applications or the Hiawatha webserver based on the URL of the incoming request.

I Googled for some reverse proxies:
  • Squid: http://wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers
  • Perlbal: http://www.danga.com/perlbal/
  • Varnish: http://varnish.projects.linpro.no/wiki/Introduction
  • Karsten
    5 October 2009, 14:22
    Hugo, you convinced me, you're absolutely right. I tried Perlbal and it's exactly doing what I want. BTW: Hiawatha and PHP (in FCGI-mode) works like a charm. Thanks Karsten.
    Hugo Leisink
    5 October 2009, 17:11
    You're welcome.
    Camel
    20 December 2009, 10:37
    Horray! I've set up Hiawatha on my personal site (camelsplace.ru). I use Xwiki as part of it (camelsplace.ru/xwiki), that works in Tomcat on 8080 port of my server, so I had to use reverse proxy to point users to it. I use Pound for it.
    Really, we don't need reverse proxy feature. Pound makes it better.
    I tried Apache and nginx. They are good, but not GPL, and their configs looks more complex, especial Apache.
    If you need reverse proxy with Hiawatha, I suggest use Pound. (This string is for search bots.)
    Hiawatha rocks!
    This topic has been closed.