<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thanks to both of you, I got the info I was seeking for.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
However, when I try to activate the fastcgi_param, the content doesn't seem to reach PHP anymore.<br>No error logged neither in Nginx nor PHP it seems.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
I feel like I am a noob... oO<br><br>server {<br> listen 80;<br> server_name ~<a href="http://ab.cd">ab.cd</a>$;<br> root /var/web/$host;<br> index index.html index.php;<br>
try_files $uri $uri/ =404;<br> access_log /var/log/nginx/<a href="http://ab.cd/access.log">ab.cd/access.log</a> main;<br> error_log /var/log/nginx/<a href="http://ab.cd/error.log">ab.cd/error.log</a> warn;<br>
include conf.d/includes/fastcgi.conf;<br> auth_basic "Get out!";<br> auth_basic_user_file /var/web/ab.cd.htpasswd;<br><br> location ~ \.php$ {<br> fastcgi_pass unix:/var/run/php-fpm.sock;<br>
<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"> #If the following is activated, no more PHP output... Something is wrong<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">
# fastcgi_param MY_GREAT_USER $remote_user;<br> }<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:30 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">
It's my understanding the $remote_user is available.<br>
<br>
Sorry, a poor example. Could have used one that answers your question<br>
directly...<br>
<span class="HOEnZb"><font color="#888888"><br>
Steve<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, 2013-02-26 at 16:23 -0500, B.R. wrote:<br>
> Thanks, I learned something there.<br>
><br>
> But does the auth_basic module allows you to load the username in a<br>
> Nginx variable?<br>
> From what I understand everything is processed internally.<br>
><br>
><br>
> ---<br>
> B. R.<br>
><br>
><br>
> On Tue, Feb 26, 2013 at 4:15 PM, Steve Holdoway<br>
> <<a href="mailto:steve@greengecko.co.nz">steve@greengecko.co.nz</a>> wrote:<br>
> 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>
><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<br>
> 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,<br>
> using PHP<br>
> > scripts inside.<br>
> ><br>
> > I wonder if it was possible to use Nginx auth information<br>
> inside those<br>
> > PHP scripts.<br>
> ><br>
> ><br>
> > More precisely, I would have a directory protected with<br>
> AuthPlain and<br>
> > I would have a script (let's call it index.php) being called<br>
> when the<br>
> > authentication is successful.<br>
> ><br>
> > The AuthPlain has several users registered and I would like<br>
> to know if<br>
> > index.php might be aware who logged in to welcom him with<br>
> his/her<br>
> > username.<br>
> ><br>
> ><br>
> > Am I dreaming too much ?<br>
> > ---<br>
> > B. R.<br>
><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>
><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>
><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>
><br>
><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>
<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>
</div></div><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>