Running Grafana on HTTPS
安装 openssl
yum install -y openssl
创建 certificates
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-days 10000 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
生成的 crt & key 文件
localhost.crt
localhost.key
配置 grafana.ini
[server]
protocol = https
...
cert_file = .../localhost.crt
cert_key = .../localhost.key
重启 grafana
systemctl restart grafana.service
访问 grafana
https://localhost:3000
网友评论