Basic Auth With Nginx

Install apache utils sudo apt-get install apache2-utils Add user sudo htpasswd -c /etc/nginx/.htpasswd foobar Enter password when prompted. Edit nginx configuration for your site in /etc/nginx/sites-enabled/: server {      listen 80;      server_name .example.com; # globally set basic auth for server name      auth_basic “Restricted”; #For Basic Auth      auth_basic_user_file Read more…