I am new to nginx and I really enjoy how fast it is in combination with php-fpm.
I want to protect a folder with
location / {
try_files $uri $uri/ $uri.php /;
auth_basic "restricted";
auth_basic_user_file /www/config/global.passwd;
}
this works by accessing /
, but on hitting /test.php
it does not ask for a password.
It does ask for one at /test/
so this only works for folders.
How to include files for protection?