Login into the server with root access
#pico /usr/local/etc/nginx/nginx.conf
First add the following to your Nginx configuration file:
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
}
Then We need to create the htpasswd file
this be passwords format will be
=================================
thisbetheusername:thisbeencryptedpass
↧
How to Add user and password .htaccess apache-like in Nginx Config
↧