Grafana: Difference between revisions

Klinger (talk | contribs)
Dander (talk | contribs)
simply explanation of setting up subpath / subdomain
Line 7: Line 7:
Grafana is available as NixOS module, it can be enabled using the following config:
Grafana is available as NixOS module, it can be enabled using the following config:


<syntaxhighlight lang=nix>
<syntaxhighlight lang="nix">
services.grafana = {
services.grafana = {
   enable = true;
   enable = true;
   settings = {
   settings = {
     server = {
     server = {
      # Listening Address
       http_addr = "127.0.0.1";
       http_addr = "127.0.0.1";
      # and Port
       http_port = 3000;
       http_port = 3000;
       # Grafana needs to know on which domain and URL it's running
      domain = "grafana.your.domain";
       domain = "your.domain";
 
       root_url = "https://your.domain/grafana/"; # Not needed if it is `https://your.domain/`
       # Alternatively, if you want to server Grafana from a subpath:
       serve_from_sub_path = true;
       # domain = "your.domain";
       # root_url = "https://your.domain/grafana/";
       # serve_from_sub_path = true;
     };
     };
   };
   };