0
点赞
收藏
分享

微信扫一扫

C# 流程图demo

追风骚年 2024-06-04 阅读 39

1 使用htpasswd 生成密码文件.htpasswd是Apache附带的工具。如果没有可以安装。

#centos 8.5 系统
yum install httpd-tools

#Ubuntu 24.04 系统
sudo  apt update
sudo apt-get  install apache2-utils

#生成密码文件,用户test
sudo htpasswd -c /usr/local/openresty/nginx/ssl/urlpasswd test
#查看
cat urlpasswd 
test:$apr1$iZ9yeHiP$KTAV51Ch9y3QwVyUAmlDh1

2 Nginx 访问加密码保护,可以通过配置基本认证(Basic Auth)来实现

#编辑配置文件
location / {
            auth_basic "test";
            auth_basic_user_file /usr/local/openresty/nginx/ssl/passwd;
           }

3 重新加载 Nginx 配置,访问

/usr/local/openresty/nginx/sbin/nginx  -s reload

 访问提示,需要用户和密码,达到预期效果。

欢迎各位同学一起交流(⊙﹏⊙)

举报

相关推荐

程序流程图

测试;流程图。

Mermaid流程图

编程流程图

SpingMVC流程图

FlowChartl流程图

0 条评论