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:

authbasic "Restricted"; authbasicuserfile /var/www/mywwebsite.com/.htpasswd;

Thanks DO!

Blog Logo

Mario Loria


Published

Image

./scriptthe.net

Because 127.0.0.1 gets old after a while.

Back to Overview