I am having trouble getting Grafana to work properly behind Caddy. Right now I have these settings:
grafana.ini:
#################################### Server ####################################
[server]
# Protocol (http, https, socket)
;protocol = http
# The ip address to bind to, empty will bind to all interfaces
;http_addr =
# The http port to use
;http_port = 3000
# The public facing domain name used to access grafana from a browser
domain = domain.net
# 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 = http://domain.net/grafana
# 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 =
;cert_key =
# Unix socket path
;socket =
and Caddyfile:
domain.net {
proxy /grafana/ http://10.9.9.132:3000 {
without /grafana/
transparent
websocket
}
}
which loads Grafana (https://domain.net/grafana) fine but if I login it redirects back to my root domain which is blank. If I remove the without /grafana/ grafana “Loads” but no resources load and its just a blank dark grafana page.
So my question is. Does anyone here sucessfully use Grafana behind Caddy server reverse proxy?
Edit: Grafana is running in a docker container using grafana/grafana. v5.4.3
Docker run command:
docker run -d --user 1000 --volume “/home/alexander/grafana:/var/lib/grafana” --volume “/home/alexander/grafana/conf:/etc/grafana” -p 3000:3000 -e “GF_SECURITY_ADMIN_PASSWORD=admin” -e “GF_INSTALL_PLUGINS=natel-influx-admin-panel,ryantxu-annolist-panel,jdbranham-diagram-panel,grafana-worldmap-panel,grafana-piechart-panel” grafana/grafana