Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"If you're seeing this Grafana has failed to load its application files" Error with Docker Grafana deployment behind reverse proxy

I have been trying to get my Grafana container to work with my reverse proxy but have had no success. Everything i try just results in the "If you're seeing this Grafana has failed to load its application files" page appearing regardless of it I access it using the internal IP or the external URL for it.

My Docker Compose in entertainer as of now, note that none of those enviroment variables are in use right now hence the #

version: '2'
services:
  grafana:
    image: grafana/grafana
    hostname: grafana
    container_name: grafana
    network_mode: le_bridge
    ports:
      - 3000:3000
    #environment: 
      #GF_SERVER_DOMAIN: 'myurl.ddns.net'
      #GF_SERVER_ROOT_URL: 'https://myurl.ddns.net:443/grafana'   
    restart: unless-stopped
    volumes: 
      - /Docker_Configs/grafana/config:/etc/grafana
      - /Docker_Configs/grafana/data:/var/lib/grafana

My grafana.ini

[server]
domain = myurl.ddns.net
root_url = https://myurl.ddns.net/grafana/

My reverse proxy config

location /grafana/{
   include /config/nginx/proxy.conf;
   proxy_pass http://192.168.2.13:3000/;
like image 820
Spencer Skinner Avatar asked Oct 03 '19 11:10

Spencer Skinner


1 Answers

If using docker, use following settings in environment to get this done.

GF_SERVER_ROOT_URL=https://myurl.ddns.net:443/grafana/
GF_SERVER_SERVE_FROM_SUB_PATH=true
like image 91
Pankaj Avatar answered Oct 10 '22 06:10

Pankaj