【zabbix7】开启HTTP authentication实现单点登录

开启HTTP authentication实现单点登录

一、新建http验证用户
bash 复制代码
htpasswd -c /etc/nginx/.htpasswd another_username
# 在提示中输入密码
二、新建Nginx配置文件

把zabbix.conf拷贝一份,然后修改listen监听的端口。

复制代码
cp zabbx.conf zabbix_http.conf
每个location中新增两行
server {
		listen          89;
        ...
        location = /favicon.ico {
                auth_basic "Restricted Content";
                auth_basic_user_file /etc/nginx/.htpasswd;
                log_not_found   off;
        }
        ...
}
三、启动nginx
复制代码
systemctl restart nginx
四、配置zabbix开启HTTP authentication

点击web界面找到用户--认证--HTTP设置

五、新建用户并设置登录后url

新建用户后,需要设置登录后url否则会出现登录后前端界面ui乱掉的问题。

六、验证

退出登录可以看到登录界面多了一个"使用HTTP登录",此时点击登录是无法登录的,因为我们界面访问的是80端口,可以http登录的是89端口,访问89端口如下

输入账号密码即可登录。

七、单点登录

配置一些跳转按钮url链接为http://another_username:another_password@192.168.113.161:89/,可以直接登录。

相关推荐
Starry_hello world1 天前
Linux http代码
linux·运维·http
九狼2 天前
Flutter SSE 流式响用 Dio 实现 OpenAI 兼容接口的逐 Token 输出
http·设计模式·api
nix.gnehc2 天前
在K8s集群中部署Traefik并验证Python HTTP服务
python·http·kubernetes
执行部之龙2 天前
HTTP常见面试题总结
网络·网络协议·http
猫头虎2 天前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty
无籽西瓜a3 天前
SSL/TLS工作流程以及HTTP与HTTPS详解
http·https·ssl
Re_Virtual4 天前
OpenEuler 20.03构建zabbix7.0 rpm包
linux·zabbix·openeuler
之歆5 天前
Varnish HTTP 缓存服务器完全指南
服务器·http·缓存
fyakm5 天前
防范HTTP安全风险:CSRF、XSS等攻击与防御策略(含代码)
安全·http·csrf
码农阿豪5 天前
解决HTTP 413错误:请求实体过大(Request Entity Too Large)的终极指南
网络·网络协议·http