grafana - 当 root_url 设置为 '%(protocol)s://%(domain)s:%(http_port)s/grafana' 时,Grafana 电子邮件没有正确的 url
问题描述
我正在为电子邮件邀请设置 Grafana Smtp。我正在使用 grafana helm chart,我的配置如下所示 -
grafana.ini:
smtp:
enabled: true
host: smtp.sendemail.com:587
user: 'someuser'
password: 'somepassword'
from_address: join-grafana@somewhere.com
from_name: Join Us At Grafana
server:
root_url: '%(protocol)s://%(domain)s:%(http_port)s/grafana'
serve_from_sub_path: true
当我发送电子邮件邀请时,电子邮件具有指向http://localhost:3000/grafana/的链接...不是我设置的域名;出于各种目的,我可以通过域名使用 grafana url,例如 - https://somedomain.com/grafana。
什么可能是错的?
解决方案
您需要实际定义所有变量,否则它们将使用默认值,这就是您在电子邮件中看到的;如果您像我一样通过代理服务器运行,您可能需要更改 URL 模板:
[server]
# Protocol (http, https, h2, socket)
protocol = http
# The http port to use
http_port = 3030
# The public facing domain name used to access grafana from a browser
domain = metrics.example.com
# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = 'https://%(domain)s/grafana/'
推荐阅读
- azure - 在 Azure Devops 发布管道上的 Appsettings.Json 中添加数组元素通过魔术块配置转换
- java - Quarkus REST 服务异常处理
- reactjs - 使用 React(Django 后端)进行 axios 调用时出现 403 禁止请求
- azure - 将 Prefetch 与 Batch 一起使用会减慢 Azure 服务总线中的消息接收速度
- python - 图形故障 ttk 小部件
- android - 颤振 https 和 http 检查
- wordpress - 将多个 Wordpress 页面合并为 1 页
- javascript - 在 TypeORM 中添加 `updatedDate` 列而不使用 Typescript 装饰器`@UpdateDateColumn`
- spring-boot - SpringBoot 2.4.1 的 OAuth2.0 迁移
- shell - 通过 shell 脚本访问 SSH 和 git sync