当root_url设置为'%(protocol)s://%(domain)s:%(http_port)s/grafana'时,Grafana电子邮件没有正确的url [英] Grafana email does not have the right url when root_url is set to '%(protocol)s://%(domain)s:%(http_port)s/grafana'
问题描述
我正在为电子邮件邀请设置Grafana Smtp.我正在使用grafana舵图,并且我的配置如下所示-
I am setting up Grafana Smtp for email invitations. I am using grafana helm chart and my configuration looks like this -
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网址,例如- https://somedomain.com/grafana.
When I send email invitations, email has the link to http://localhost:3000/grafana/... not the domain name I have set; For every purpose, I am able to use the grafana url by domain name like - https://somedomain.com/grafana.
可能有什么问题吗?
推荐答案
您需要实际定义所有变量,否则它们将使用默认值,即您在电子邮件中看到的值.如果像我一样通过代理服务器运行,则可能需要更改URL模板:
You need to actually define all the variables, else they will use the default value, which is what you are seeing in your email; if you are running through a proxy server like I do, you might need to change the URL template:
[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/'
这篇关于当root_url设置为'%(protocol)s://%(domain)s:%(http_port)s/grafana'时,Grafana电子邮件没有正确的url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!