Quantcast
Viewing all articles
Browse latest Browse all 15

How to Add user and password .htaccess apache-like in Nginx Config



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

read more


Viewing all articles
Browse latest Browse all 15

Trending Articles