1

I have been looking for good easy to use examples for lighthttpd proxy reverse proxy. My idea is to take domain example.com and forward/reverse proxy to ip 192.168.0.1 port 80, whether it is a tomcat server or apache web server.

Or even to take example.com and proxy it to facebook.com

Any ideas?

Riaan
  • 421
  • 5
  • 13

1 Answers1

2

It's fairly simple:

$HTTP["host"] == "www.example.com" {
proxy.server = (
    "" => (
        ("host" => "127.0.0.1", "port" =>8000)
    )
)
}
growse
  • 8,020
  • 13
  • 74
  • 115
  • Thx for the reply. I have found several examples in the last 2 weeks. I am looking for something like this, but does not seem to work $HTTP["host"] == "example.com" { proxy.server = ( "" => ( ("host" => "www.google.com", "port" =>80) ) ) } – Riaan Mar 14 '11 at 19:29
  • Don't quote me on this, but I don't think you can reverse proxy to a DNS name, I think it's got be an IP. It's a slightly strange setup - why are you trying to reverse proxy to a completely different site, out of curiosity? – growse Mar 14 '11 at 20:33
  • I am trying to combine several web servers into one. for example web.mydomain.com, admin.mydomain.com which would translate to something like 192.168.0.1 port 81 and admin.otherdomain. there is a couple of them and it would just be easier to have one central web sever managing all the web interfaces. I have found so far that apache would work better for this purpose. I was just trying lighthttpd because it looked easier to achieve this. thx for the help and advice. – Riaan Mar 15 '11 at 07:20