Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It's fairly simple:

$HTTP["host"] == "www.example.com" {
proxy.server = (
    "" => (
        ("host" => "127.0.0.1", "port" =>8000)
    )
)
}
share|improve this answer
    
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 7:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.