Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Nginx Htpasswd Directory  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

nirmal

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Nginx Htpasswd Directory
« on: November 17, 2013, 06:17:48 pm »
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
Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!