Password Protect Directory with NGinx

& Ubuntu 16.04

sudo apt-get install apache2-utils
htpasswd -c /home/username/.htpasswd username

Login: username
Password: your_cool_password

those lines are added to "/etc/nginx/sites-available/cool_site_config config

location /restricted_area {
        auth_basic "Administrator Login";
       auth_basic_user_file /home/username/.htpasswd;
}
Posted on October 3, 2017 at 16:59 by arte · Permalink
In: English, Linux, nginx, Ubuntu

Leave a Reply