title: Iptables redirect to remote squid proxy
body: <p>I want to redirect any http traffic generated from local host to a remote squid. </p>
  
  <p>HTTP server located in one data center, if any web based(http) outbound request is generated, it should be redirect to remote squid server(located in a remote data center). I have have verified that squid proxy is working fine.  </p>
  
  <p>HTTP server has one interface <code>eth0</code>. I have write following iptables rule but it is not working.<p>
  Web server IP = 192.168.1.1 <br/>
  Proxy Server IP/Port = publicip:3128</p>
  
  <pre><code>iptables -t nat -A PREROUTING -p tcp -s 192.168.1.1 --dport 80 -j DNAT --to-destination  publicip:3128
  iptables -t nat -A POSTROUTING -j MASQUERADE
  </code></pre>
  
  <p>But above rules are not working. </p>