I have successfully running a grafana instance on my server. It runs on http
without a problem. Now I want to switch from http
to https
. My grafana.ini
is shown bellow:
[server]
Protocol (http, https, h2, socket)
protocol = https
The http port to use
http_port = 8080
The public facing domain name used to access grafana from a browser
domain = mydomain.com
Redirect to correct domain if host header does not match domain
Prevents DNS rebinding attacks
enforce_domain = false
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 = %(protocol)s://%(domain)s:%(http_port)s/
Serve Grafana from subpath specified in root_url
setting. By default it is set to false
for compatibility reasons.
serve_from_sub_path = false
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 =“C:\Program Files\GrafanaLabs\grafana\wildcard.cer”
cert_key =“C:\Program Files\GrafanaLabs\grafana\wildcard.key”
I am getting the below error while starting the grafana service
t=2022-02-10T17:04:19+0000 lvl=info msg=“HTTP Server Listen” logger=http.server address=[::]:8080 protocol=https subUrl= socket=
t=2022-02-10T17:04:19+0000 lvl=eror msg=“Stopped HTTPServer” logger=server reason=“tls: found a certificate rather than a key in the PEM for the private key”
t=2022-02-10T17:04:19+0000 lvl=info msg=“Stopped Stream Manager”
t=2022-02-10T17:04:20+0000 lvl=eror msg=“A service failed” logger=server err=“tls: found a certificate rather than a key in the PEM for the private key”
t=2022-02-10T17:04:20+0000 lvl=eror msg=“Server shutdown” logger=server reason=“tls: found a certificate rather than a key in the PEM for the private key”
Can some one help me on this.