Nginx Password Protect a website

nginx password protect

To password protect a web site, you need to install htpasswd utility. On Ubuntu/Debian, you can install it with command

Now create a password file with command

It will ask for password.

Edit configuration file for your web site and add following in the server entry for the web site.

Restart Nginx.

Now on visiting the web site, you will be asked to enter username and password.

If you need to allow SSL renewals, then see SSL Renewal On Nginx Password Protected site

See Nginx

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *