Prometheus Web認證和告警實現


一、Prometheus基於nginx反代實現Web認證

    部署過prometheus的應該都知道,它是沒有做任何認證的,直接輸入IP+端口就能訪問,這意味着你的數據在公網上裸奔,這在生產環境中是絕對不行的。可通過nginx的反向代理實現Prometheus Web認證。

Web_certifica_for_prometheus.sh:

#!/bin/bash
# Write by afei

# judge install nginx
if rpm -qa |grep ^nginx-1 && rpm -qa |grep ^nginx-mod; then
	nginx -V
else
	yum -y install nginx
	nginx -V
fi

htpasswd -c /etc/nginx/pr
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章