Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have got a few web servers running on my server and I want all of them to be accessible via port 80. I set up squid as a reverse proxy and it works fine. I, however, need the source ip address to be kept when the requests are redirected to the servers. Otherwise, the servers see all the connections to be originated from localhost, which isn't very good.

I know there is an option forwarded_for which creates X-Forwarded-For header, but it is not really transparent and not every server supports it.

share|improve this question
You need to look at Tproxy. – Khaled Apr 23 '13 at 13:14
Do you need squid or could you replace it with another proxy? – mkzero Apr 23 '13 at 13:38
I look at the TProxy. I would be very happy, if I could keep squid, however, if there is a better alternative, I can switch. – tach Apr 23 '13 at 13:53
If you had squid keep the original clients IP in the TCP headers the web servers would need to have the transparent squid proxy set as their default gateway in order for the traffic to get back to where it came from I believe. – jwbensley Apr 23 '13 at 14:15
Since it is on the same machine, the packets can be intercepted on their way back. It can be difficult to implement, but still possible. – tach Apr 23 '13 at 14:20

Your Answer


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

Browse other questions tagged or ask your own question.