type
status
slug
summary
tags
category
icon
password
new update day
Property
Oct 22, 2023 01:31 PM
created days
Last edited time
Oct 22, 2023 01:31 PM
1 创建htpasswd文件
可以使用下面这个python脚本生成认证文件
2 执行命令 授予脚本执行权限
此处是测试演示所以权限赋予了
777
实际实用的时候应自己进行配置。其中 htpasswd是生成的文件名,username 是用户名,password是对应的密码
3 把生成的文件复制到 nginx 文件夹里
eg:/etc/nginx/
修改 nginx 的
conf
或 nginx 的虚拟服务器配置文件,
在 server 条目上加上这两句- 然后重启nginx
OK!大功告成!
- Author:tangcuyu
- URL:https://expoli.tech/articles/2018/04/16/1564656224308
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts