When acting as a proxy, Squid by default adds a header named “X-Forwarded-For” to each request. This header contains the IP address of the client that made the request. However, it’s possible to hide the system’s real IP address by configuring Squid to remove this header.
Here’s how to do it:
- Open the Squid configuration file, which is typically located at
/etc/squid/squid.conf
. - Find the
http_access
directive and add the following line to it:forwarded_for off
This will tell Squid to not include the “X-Forwarded-For” header in the requests it sends to the destination server.
- Save the configuration file and restart Squid for the changes to take effect.
Note that by hiding the system’s real IP address, the destination server will not know the true source of the request. This can be a security risk if the server relies on IP addresses for access control.