Grafana email does not have the right url when root_url is set to '%(protocol)s://%(domain)s:%(http_port)s/grafana'

橙三吉。 提交于 2021-02-11 04:21:37

问题


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

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.

What could possibly be wrong?


回答1:


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/'


来源:https://stackoverflow.com/questions/60049258/grafana-email-does-not-have-the-right-url-when-root-url-is-set-to-protocols

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!