Select Page

Nginx 配置访问网站密码方法

Nginx 配置访问网站密码方法



# 安装httpd
yum install httpd


  location  /
  auth_basic "Hit Me";
  auth_basic_user_file /usr/local/nginx/conf/htpasswd;


htpasswd -c /usr/local/nginx/conf/htpasswd 你的用户名


lnmp nginx restart


About The Author

Jackie Sung

Jackie Sung, also known by his nick-name KK, always strives for the best and learn from the best. Influenced by the age of Internet, for the last few years, in his spare time, he's been working and living as a Freelance Web Engineer/ Web Developer & Designer/ Amateur Photographer/ Husky Lover. The work he provides is of highest quality, fully-customized responsive, and tested in a wide range of devices, which typically covers both front-end (HTML5/ CSS3/ JavaScript) and back-end (WordPress as the CMS) responsibilities.

Leave a reply

电子邮件地址不会被公开。 必填项已用*标注

15 − 5 =

Pin It on Pinterest

Share This