Using Squid as a transparent *outgoing* proxy
My web server is going to be making lots of API calls to several websites and so I'd like for it to cache those calls locally. I don't want incoming user traffic to go through the proxy.
I'm running Ubuntu 10.04LTS, with the latest version of Squid installed from apt.
I followed this:
But of course this ended in my requests to myserver.com hitting a squid error page.
Could anyone assist me configuring squid for my needs?
1 Reply
iptables -t nat -A OUTPUT -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
I'm no Squid expert so you may need to tweak the Squid settings as well, but this rule will at least get outbound HTTP traffic (and only outbound HTTP traffic) redirected towards Squid.
(Make sure you remember to remove the old iptables rules.)