Re: Using Nginx auth in PHP scripts

2013-02-26 Thread B.R.
Thanks for your great help! Now I think I got it all. Well it was non-sense to put fastcgi out of the PHP location anyway... but I didn't know about the environment problem. I'll try to think about that next time something I play with Nginx configuration. Everything is OK now. --- *B. R.* On T

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread Francis Daly
On Tue, Feb 26, 2013 at 05:26:49PM -0500, B.R. wrote: > I feel like I am a noob... oO The problem is due to how nginx directives are inherited to different levels. It's consistent within nginx, so once you learn it you can apply it to all directives which inherit. Just put your new fastcgi_param

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread B.R.
Thanks to both of you, I got the info I was seeking for. However, when I try to activate the fastcgi_param, the content doesn't seem to reach PHP anymore. No error logged neither in Nginx nor PHP it seems. I feel like I am a noob... oO server { listen 80; server_name

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread Steve Holdoway
It's my understanding the $remote_user is available. Sorry, a poor example. Could have used one that answers your question directly... Steve On Tue, 2013-02-26 at 16:23 -0500, B.R. wrote: > Thanks, I learned something there. > > But does the auth_basic module allows you to load the username in

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread Francis Daly
On Tue, Feb 26, 2013 at 04:23:14PM -0500, B.R. wrote: Hi there, > But does the auth_basic > moduleallows > you to load the username in a Nginx variable? > From what I understand everything is processed internally. http://nginx.org/en

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread B.R.
Thanks, I learned something there. But does the auth_basic moduleallows you to load the username in a Nginx variable? >From what I understand everything is processed internally. --- *B. R.* On Tue, Feb 26, 2013 at 4:15 PM, Steve Hol

Re: Using Nginx auth in PHP scripts

2013-02-26 Thread Steve Holdoway
You can pass environment vars to PHP no problem... Eg: if you set up geoip in nginx.conf geoip_country /usr/share/GeoIP/GeoIP.dat; this makes $geoip_country_code available to your nginx config. If you then set fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code; then $_SERVER['GEO

Using Nginx auth in PHP scripts

2013-02-26 Thread B.R.
Hello, The only information I got on the Web was to protect folders with Nginx auth, just like the plein old Apache's .htaccess. I am already using AuthPlain to secure a folder with Nginx, using PHP scripts inside. I wonder if it was possible to use Nginx auth information inside those PHP scripts