Hello,
i have recently migrate from apache to Nginx and i very apreciate rapiditly of Nginx.
i have probleme when i have restricted acces to folder /var/www/restricted/ i have create creapted file .passwd on /etc/nginx/conf.d/ and i have add this on default site
location /restricted/ {
auth_basic "Restricted access";
auth_basic_user_file /etc/nginx/conf.d/.passwd;
}
All fine, when i want to access http://www.test.com/restricted/ i have pop up ask me authentification but i have two probleme :
1st probleme : when i put user and password who have encrypte on .passwd i don't redirected from http://www.test.com/restricted/ to http://www.test.com/restricted/index.php
2nd probleme : only folder /var/www/restricted/ was protected, other files and sub-folders has been not protected :(
My question is : how can i protecte folder /var/www/restricted/ with all files and sub-folders and how can i create redirection for index.php