$sudo apt-get update
$sudo apt-get install apache2-utils
$sudo htpasswd -c /etc/nginx/.htpasswd [username]
$cat /etc/nginx/.htpasswd
location / {
try_files $uri $uri/ =404;
auth_basic “Restricted Content”;
auth_basic_user_file /etc/nginx/.htpasswd;
}
$sudo service nginx restart