1 Open the configuration file in the conf
Join in on server under location
auth_basic "the Input Password:" ; the pop-up message
auth_basic_user_file "/ usr / local / nginx / Pass" ; authentication password file
2. htpasswd generate the corresponding password file (httpd-tools to install package).
htpasswd -c /usr/local/nginx/pass lqinghua
Enter the password twice