I can't modify PHP code. I've managed to do this for Apache by adding the line export http_proxy="http://myproxy:port" in /etc/apache2/envvars Posted at Nginx Forum: http://forum.nginx.org/read.php?2,244407,244410#msg-244410