Reputation: 141
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/;
Upvotes: 14
Views: 24213
Reputation: 51
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
Upvotes: 4
Reputation: 758
This broke for me when upgrading from 7.2.0 to 7.3.1. The issue is that grafana is listening on port 3000 and your reverse proxy is on port 443. Grafana is looking for assets on port 443 of the grafana host (where it is not listening) instead of on 3000 (where it is listening).
The fix is to add the external port to the root_url
param in grafana.ini
.
root_url = https://myurl.ddns.net:443/grafana/
Then grafana will understand that the port used by the reverse proxy and grafana itself are different, and behave correctly.
Upvotes: 0