Confused with how server.domain and server.root_url are working

Recently I am doing the proxy configuration for grafana. I used an Apache httpd server as the reverse proxy server and I followed the instruction of http://docs.grafana.org/installation/behind_proxy/ and it works.

However, I am confused with the attributes server.domain and server.root_url. The docs say server.root_url should be exact the one you put in your browser and server.domain is just the domain part of server.root_url. I am wondering how are they working? I mean as long as the DNS server gives the mapped grafana server for the url, grafana should work, right? Also, what if I deploy grafana inside a docker container? I could not determine the domain since the host ip will be different.

In fact, I have tried put server.domain as a dummy string and keep the domain part of server.root_url the same with it, grafana also works.

Here is an example config I use:

[server]
domain=abcdefg:3000
root_url=http://abcdefg:3000/grafana

apache httpd proxy config:

ProxyPass /grafana/ http://grafana.staged-by-discourse.com/
ProxyPassReverse /grafana/ http://grafana.staged-by-discourse.com/

With the above config, when I put “httpd_server_ip/grafana/” I can also get grafana login page.

1 Like

domain is just a variable that is per default used in the root_url variable. The root_url variable is the important one.

From the docs for domain:

This setting is only used in as a part of the root_url setting

1 Like