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

相关推荐
坐怀不乱杯魂8 小时前
Linux网络 - HTTPS
服务器·网络·网络协议·http·https
强风7948 小时前
Linux-HTTPS协议原理
网络协议·http·https
lanhuazui109 小时前
雅讯SDK 怎么确认测试的每个http方法是否成功
http
Fᴏʀ ʏ꯭ᴏ꯭ᴜ꯭.11 小时前
双主模式实现HTTP与MySQL高可用
网络协议·mysql·http
猿小羽12 小时前
MCP Server 运行模式入门(Streamable HTTP / stdio)
http·ai·ai实战·mcp·mcp server
wljt14 小时前
HTTP和openFeign
网络·网络协议·http
bjxiaxueliang14 小时前
一文掌握SpringBoot:HTTP服务开发从入门到部署
spring boot·后端·http
坐怀不乱杯魂1 天前
Linux网络 - HTTP协议
网络·网络协议·http
REDcker1 天前
HTTP请求数据包流转详解:localhost、127.0.0.1、公网 IP、公网域名访问时的数据流转
网络·tcp/ip·http