0
votes

I'm trying to setup Grafana behind Nginx reverse proxy, but I have {{alert.title}} error every time I'm trying to lunch it over a browser.

Grafana is running in docker container inside Kubernetes cluster with opened port 30000. Nginx is running inside VM with public IP.

I can successfully curl url with Grafana from nginx VM.

I don't have public DNS name assigned to my public IP yet, so I'm using public IP instead of DNS name in configs (but I also tried to use DNS name by adding correct records in /etc/hosts - the same)

I read this article "http://docs.grafana.org/installation/behind_proxy/ " and made some changes in my grafana.ini:

domain = PUBLIC_IP
root_url = https://PUBLIC_IP/grafana

and in nginx.conf

  server {
    listen       443 ssl;
    server_name PUBLIC_IP;
    ssl_certificate           /etc/nginx/cert.crt;
    ssl_certificate_key       /etc/nginx/cert.key;

    ssl on;
    ssl_session_cache  shared:SSL:1m;
    ssl_session_timeout 10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location  /grafana/ {

       proxy_pass          http://IP_WHERE_LIVES_GRAFANA:30000/;
    }

}

Nginx access.log:

2018/05/18 11:31:54 [error] 10847#0: *468 open() "/usr/share/nginx/html/public/css/grafana.dark.min.af13213c.css" failed (2: No such file or directory), client: CLIENT_PUBLIC_IP, server: PUBLIC_IP, request: "GET /public/css/grafana.dark.min.af13213c.css HTTP/1.1", host: "PUBLIC_IP", referrer: "https://PUBLIC_IP/grafana/"
1
are you sure your grafana.ini is being loaded? are those entries properly nested under the [server] section? Can you share the <head> section of the html you get from Grafana?AussieDan
Thanks a lot for the advice! I had GF_SERVER_ROOT_URL environment variable in my Grafana deployment, that's why it didn't use root_url from config.Oles Rid

1 Answers

2
votes

I didn't notice that I have GF_SERVER_ROOT_URL environment variable in my yaml Grafana deployment. So it used environment variable instead of grafana.ini