我已成功在我的服务器上运行grafana实例。它在http
上运行没有问题。现在我想从http
切换到https
。我的grafana.ini
如下所示:
#################################### Server ####################################
[server]
# Protocol (http or https)
protocol = https
# The ip address to bind to, empty will bind to all interfaces
http_addr = 0.0.0.0
# The http port to use
http_port = 3000
# The public facing domain name used to access grafana from a browser
;domain = localhost
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false
# The full public facing url
;root_url = %(protocol)s://%(domain)s:%(http_port)s/
# Log web requests
;router_logging = false
# the path relative working path
;static_root_path = public
# enable gzip
;enable_gzip = false
# https certs & key file
cert_file = /usr/local/ssl/crt/certificate.cer
cert_key = /usr/local/ssl/private/private_key.key
答案 0 :(得分:3)
以上配置可能有问题:更改grafana.ini
文件后," grafana-server"服务不会重新开始。
以下是我解决问题的方法:
grafana.ini
。/etc/grafana
。go+r
),将所有者更改为root:root
。之后,grafana服务将在HTTPS模式下正常工作。
答案 1 :(得分:1)
建议为证书和密钥文件赋予与 /etc/grafana 下的其他文件相同的权限。 chgrp grafana ; chmod 640