Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to get lighttpd or apache2 (I prefer lighttpd) to work behind a proxy but no luck so far.

What I want is to run lighttpd (or port 80) behind a proxy, so that when someone goes to, and the DNS for that domain is pointed to the IP address of the proxy server, they end up on my http server's page.

This would allow me to use the server's resources, while keeping it's IP address hidden.

Unfortunately, using the proxychains program did not work. For lighttpd it gave the error getaddrinfo failed: Unknown error ' ::' and proxychains apache2 start started just fine, but it didn't seem to do anything. I did test if the proxychains program itself worked, and it used the proxy just fine using curl on a what-is-my-ip type of website.

If you're wondering; I am temporarily using a homeserver, and I don't want to make my IP address public.

Any ideas? Both a HTTPS proxy (squid) or a SOCKS5 (dante) proxy will do just fine.

share|improve this question

The proxy that you chose must support "reverse HTTP proxying". See:

share|improve this answer
This isn't an answer to my question ;O – natli Apr 19 '12 at 13:42

You mentioned that squid would work just fine. Is there a reason you didn't just fire up squid? It's probably the simplest proxy solution to configure.

share|improve this answer
I don't know how to use the http server behind the squid proxy. – natli Apr 19 '12 at 19:51

Using Apache and mod_proxy you could write one or more simple rules such as

ProxyPass /foo http://internal-ip/bar

This way the Apache server hides the internal server(s).

share|improve this answer
I already tried mod_proxy. I set up an ssh connection to the proxy server in Daemon mode using port 5555, and then added ProxyPass / http://localhost:5555 to the config, but it didn't do anything. – natli Apr 19 '12 at 13:44
I've probably misunderstood something. Why SSH, why did you set up a connection and why localhost? I though the scenario was that a HTTP reqyest was made from the Internet to the Proxyy server, which then redirected the HTTP request to the internal server? – erikxiv Apr 19 '12 at 13:47
I should have been more clear, this is why I used SSH to get the proxy connection: link to article . And yes, that's exactly what I'm trying to do. – natli Apr 19 '12 at 13:53
I believe that proxychains allow you to start a program on your client machine and route all the network traffic from that program through SSH to your SSH server, essentially acting as if the program (such as a web browser) were running on the SSH server (inside your local network). Is that what you want to achieve? If so, you should not use neither Apache nor lighttpd, but only proxychains. – erikxiv Apr 19 '12 at 14:32
Proxychains didn't do anything, as I stated in my question. I don't know why it doesn't just work.. it should ;/ And how would I be serving web pages if I wasn't using apache or lighttpd? I'm trying to run a server here, not visit some website using a proxy. Someone request page -> Proxy sends request to http server -> http server serves page to proxy server -> proxy server forwards page to requester. – natli Apr 19 '12 at 19:52

Your Answer


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.