Define a proxy for Nginx

António P. P. Almeida appa at
Tue Nov 5 15:25:10 UTC 2013

Assuming you're using php-fpm or php-cgi you can set a param to pass that
as a server variable:

fastcgi_param HTTP_PROXY 'http://proxy:myport';

Then you'll have a $_SERVER['HTTP_PROXY'] entry for the global $_SERVER.



On Mon, Nov 4, 2013 at 3:09 PM, odesport <nginx-forum at> wrote:

> 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:
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list