What's the easiest way to restrict access to all files except one, where whole domain is served via FastCGI?
The problem occurring when below conf is used, is that I cannot access /dir (I'm asked for password in some kind of loop, correct login+password is not letting me in).
Besides, same fastCGI config is duplicated in location = /unrestricted_file.php and location ~ .php$.
Structure is:
server {
location = /unrestricted_file.php {
# FastCGI conf...
break;
}
location / {
root
index
auth_basic "Restricted";
auth_basic_user_file file;
}
location /dir {
auth_basic "Restricted";
auth_basic_user_file file;
}
location ~ \.php$ {
auth_basic "Restricted";
auth_basic_user_file file;
# fastcgi_pass...
}
}