<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thanks, I learned something there.<br><br>But does the <a href="http://nginx.org/en/docs/http/ngx_http_auth_basic_module.html">auth_basic module</a> allows you to load the username in a Nginx variable?<br>
>From what I understand everything is processed internally.<br></div></div><div class="gmail_extra"><br clear="all"><div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div>
<br><br><div class="gmail_quote">On Tue, Feb 26, 2013 at 4:15 PM, Steve Holdoway <span dir="ltr"><<a href="mailto:steve@greengecko.co.nz" target="_blank">steve@greengecko.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can pass environment vars to PHP no problem...<br>
<br>
Eg: if you set up geoip in nginx.conf<br>
<br>
geoip_country /usr/share/GeoIP/GeoIP.dat;<br>
<br>
this makes $geoip_country_code available to your nginx config.<br>
<br>
If you then set<br>
fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;<br>
<br>
then<br>
<br>
$_SERVER['GEOIP_COUNTRY_CODE'] is then available to php.<br>
<br>
This can be done for any variable set within nginx.<br>
<br>
hth,<br>
<br>
Stve<br>
<div><div class="h5"><br>
<br>
On Tue, 2013-02-26 at 15:58 -0500, B.R. wrote:<br>
> Hello,<br>
><br>
><br>
> The only information I got on the Web was to protect folders with<br>
> Nginx auth, just like the plein old Apache's .htaccess.<br>
><br>
><br>
> I am already using AuthPlain to secure a folder with Nginx, using PHP<br>
> scripts inside.<br>
><br>
> I wonder if it was possible to use Nginx auth information inside those<br>
> PHP scripts.<br>
><br>
><br>
> More precisely, I would have a directory protected with AuthPlain and<br>
> I would have a script (let's call it index.php) being called when the<br>
> authentication is successful.<br>
><br>
> The AuthPlain has several users registered and I would like to know if<br>
> index.php might be aware who logged in to welcom him with his/her<br>
> username.<br>
><br>
><br>
> Am I dreaming too much ?<br>
> ---<br>
> B. R.<br>
</div></div>> _______________________________________________<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><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Steve Holdoway BSc(Hons) MIITP<br>
<a href="http://www.greengecko.co.nz" target="_blank">http://www.greengecko.co.nz</a><br>
Skype: sholdowa<br>
</font></span><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><br></blockquote></div><br></div>