sudo apt-get install apache2-utils sudo htpasswd -c /var/www/mywebsite.com/.htpasswd exampleuser
Put the following in your nginx conf file for the given server block you want this to apply to:
auth_basic “Restricted”; auth_basic_user_file /var/www/mywwebsite.com/.htpasswd;
Thanks DO!