iframe嵌入grafana配置记录

716 阅读1分钟

账密登录配置

允许账密登录并保存cookie信息,下次直接登录

# set to true if you host Grafana behind HTTPS. default is false.
cookie_secure = true

# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
cookie_samesite = none

# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
allow_embedding = true

开启HTTPS

安装 openssl

yum install -y openssl

创建 certificates,生成的 crt & key 文件

openssl req -x509 -out server.crt -keyout server.key -newkey rsa:2048 -nodes -sha256 -days 10000
server.crt
server.key

配置 grafana.ini

[server]protocol=https
cert_file=…/server.crt
cert_key=…/server.key

重启 grafana

systemctl restart grafana.service

访问 grafana

https://ip:3000