【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/,可以直接登录。

相关推荐
basketball6169 小时前
HTTP协议返回状态码总结
网络·网络协议·http
是Yu欸13 小时前
CC-Switch 零基础保姆级教程1(2026 最新版)
网络·人工智能·网络协议·http·大模型·claude·claude desktop
夏天测13 小时前
【高危漏洞通告】NGINX ngx_http_rewrite_module 堆缓冲区溢出漏洞;详解与修复方案
运维·nginx·http
FallenQu14 小时前
【漏洞】CVE-2026-42945:NGINX ngx_http_rewrite_module 堆缓冲区溢出深度分析
运维·nginx·http
yqcoder17 小时前
服务器的“红绿灯”:图解常见 HTTP 状态码
运维·服务器·http
万山寒1 天前
redhat 9 安装zabbix server pgsql
zabbix
薛定谔的猫喵喵2 天前
【从 HTTP 到 HTTPS】Flask 多项目迁移到 Nginx 子路径完整实战
python·nginx·http·https·flask·ssl
曾阿伦2 天前
requests HTTP 库解析
网络·网络协议·http
福大大架构师每日一题2 天前
nginx 1.31.1 发布:一次安全修复驱动的主线升级,涉及 Rewrite、HTTP/2、Mail、MP4 与工作流修正
nginx·安全·http
catchadmin2 天前
TrueAsync Server 为 PHP 带来了原生的高性能 HTTP 服务器
服务器·http·php