How to use iptables on linux make PHP outgoing connections through a proxy?

view full story

http://serverfault.com – I write a web based proxy by PHP+curl, on my network some site need through proxy, if I use the CURLOPT_PROXY setting, it has some redirects, so will return 302 error, if add CURLOPT_FOLLOWLOCATION to 1, the windows will jump to other, so can't show in my ifream, is there someway to set iptables make php outgoing connections through proxy? (HowTos)