<div dir="ltr"><div><div><div>As for the first point, of course that variable needs to be used on the application side.<br></div><div>The OP suggested that is cased since he described basically that with the Apache env var<br>
</div><div>directive.<br></div><div><br>As for  the second, I was not considering security issues, but:<br><br></div>1. You need to be able to edit the php-fpm configuration.<br><br></div>2. You need to do a reload for the config to take effect.<br>
<br></div>In a properly setup Nginx both of these require *root* access.<br><div class="gmail_extra"><br></div><div class="gmail_extra">Yes it's hardly the best way to do things. But then it works and it isn't either the worst.<br>
<br></div><div class="gmail_extra">Note that it's not a header at all, but a parameter passed through the FCGI daemon on each<br></div><div class="gmail_extra">request.<br></div><div class="gmail_extra"><br clear="all">
<div>----appa<br><br></div>
<br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 10:24 AM, Jonathan Matthews <span dir="ltr"><<a href="mailto:contact@jpluscplusm.com" target="_blank">contact@jpluscplusm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 5 November 2013 15:25, António P. P. Almeida <<a href="mailto:appa@perusio.net">appa@perusio.net</a>> wrote:<br>
> Assuming you're using php-fpm or php-cgi you can set a param to pass that as<br>
> a server variable:<br>
><br>
> fastcgi_param HTTP_PROXY 'http://proxy:myport';<br>
><br>
> Then you'll have a $_SERVER['HTTP_PROXY'] entry for the global $_SERVER.<br>
<br>
</div>I don't think this is right, for a couple of reasons.<br>
<br>
Firstly, some reading has suggested that there isn't a way to force<br>
the stock PHP HTTP request libraries to use a proxy just by setting an<br>
envvar. Witness, for instance, the code-level changes that are<br>
(/were?) required to get a relatively mainstream piece of s/w like WP<br>
to work with an outbound proxy:<br>
<a href="http://wpengineer.com/1227/wordpress-proxysupport/" target="_blank">http://wpengineer.com/1227/wordpress-proxysupport/</a><br>
<br>
Secondly, the specific string mentioned would (unless I'm missing<br>
something, which is very possible!) open a security hole: $_SERVER<br>
contains all user-specified HTTP request headers with added "HTTP_"<br>
prefixes. The method suggested, if it worked, would mean that, as a<br>
user, I could simply provide a "Proxy: my.proxy.server.ip" header and<br>
get all outbound HTTP traffic (for my request) proxied via *my*<br>
external server. Thereby exposing internal information such as 3rd<br>
party API passwords, internal HTTP API call details, etc etc.<br>
<br>
Again, I may be missing something with either of these points but,<br>
obviously, I don't see what it might be! :-)<br>
<br>
Regards,<br>
Jonathan<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></blockquote></div><br></div></div>