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!大功告成!
Ubuntu 安装 nginxUbuntu 没有声音的解决方法