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 want to set up a squid gateway, which doesn't forward the X-Forwarded-For header to most of the websites. But I want it to be forwarded to a specific domain. Here's the sample I'm trying to accomplish:

Scenario 1: User visits . No X-Forwarded-For is send, since it's an internal IP address, so only the WAN Address should be visible in that header (eg

Scenario 2: User visits . The X-Forwarded-For is send, containing the local IP (e.g., so my the can see from where in our network the request origins.

I want to implement this as an extra security layer, so that people from e.g. the Sales dept cannot visit services for people from the R&D dept, even if they have one of the R&D usernames.

Is this actually possible? And if yes, can I do this with squid, or do I need other software? Are there any tutorials/manuals/etc on this subject?

Thank you,


share|improve this question
up vote 0 down vote accepted

Try using header_access squid option

share|improve this answer
could you provide a sample for conditional URLs/hostnames? – friedkiwi May 3 '11 at 17:05

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.