Nginx Htpasswd Directory
Hi,
Are you using Nginx and searching for an alternative for htpasswd.?. Here you go, all you need to do is add the below lines in your virtual host configuration file.
location ~ /downloads {
root /path/to/reach/downloads/directory/;
autoindex on;
auth_basic "Restricted";
auth_basic_user_file /path/to/your/htpass/file;
}
If you are not sure how to create a htpasswd file for Nginx use the below command.
htpasswd -c htpass <username> <password>
Thank you for viewing helpinlinux.com
| Print article | This entry was posted by Siru on February 16, 2012 at 4:50 pm, and is filed under linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |