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!大功告成!
Relate Posts
自建 tailscaler derper 中继服务
Lazy loaded image
树莓派寄存器物理基地址查询
Lazy loaded image
CS144-2023-Spring router.cc 功能部分实现讲解
Lazy loaded image
CS144-2023-Spring network_interface.cc 功能部分实现讲解
Lazy loaded image
[MIT 6.s081] Lab: Copy-on-Write Fork for xv6 实验记录
Lazy loaded image
Linux 0.11 中的 put_page 函数
Lazy loaded image
Ubuntu 安装 nginxUbuntu 没有声音的解决方法
Loading...
tangcuyu
tangcuyu
一只尘世中努力争渡的🐠
Latest posts
自建 tailscaler derper 中继服务
2024-11-9
在 CentOS 9 上编译 DPDK 与 pktgen 24.07
2024-11-1
CentOS 9 DPDK 源码编译
2024-10-31
在 CentOS 9 上启用 CRB 源
2024-10-16
Rime 小狼毫定时用户词库同步设置
2024-5-1
在 Arch Linux 上通过 OneDrive 进行 rime 的用户词库同步
2024-4-20