Welcome! Log In Create A New Profile

Advanced

Restricte access to folder

Posted by fs_djmellisse 
Restricte access to folder
April 30, 2011 09:58PM
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
Attachments:
open | download - default-site.txt (1.1 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready