nginx 设置htpasswd实现网站认证访问

#htpasswd 是开源 http 服务器密码认证生成工具
#Centos环境
#没有什么是一个视频不能解决的

yum -y install httpd
#首先创建文件生成密码:
htpasswd -c /usr/local/nginx/passwd root (创建文件并生成一个账户)
htpasswd -b /usr/local/nginx/passwd root root1 (增加账户)
#nginx.conf配置
auth_basic  "enter you password:";
auth_basic_user_file /usr/local/nginx/passwd;

**#在线观看视频更清楚

nginx使用htpasswd设置访问权限


**

发布了26 篇原创文章 · 获赞 24 · 访问量 1953

猜你喜欢

转载自blog.csdn.net/wnw001/article/details/104483245