Squid Proxy - The requested URL could not be retrieved

I'm trying to redirect all of my subnet traffic to a squid proxy using iptables on the router gateway (the squid proxy is located in the LAN).

The redirection works (cache & access file respond well), but the requested page page shows an error (image is attached)

Squid version:3.5.27 The iptables lines that we used for the redirection: 192.168.0.110:3129 - the squid box port+IP. 192.168.0.1 - the router's IP.

iptables:

  1. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.0.110:3129

  2. iptables -t nat -A POSTROUTING -p tcp -d 192.168.0.110 --dport 3129 -j SNAT --to-source 192.168.0.1

squid.conf

These are the lines that we have changed/added to the squid.conf:

acl localnet src 192.168.0.0/24
http_access allow localnet
http_port 3129 

error imgI can't figure it out where is the problem (iptables or squid.conf file). Thank you in advance. Chat Conversation End Type a message...

1 Answer

It seems you are trying to configure a transparent proxy, so I guess you just miss the transparent argument to your http_proxy settings. Modify the line with the following syntax:

http_port 3128 transparent

Restart the service and try again.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like