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.

See Nginx

Leave a Reply

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