I've installed Grafana behind Nginx running as a reverse proxy for it and then behind Cloudflare. Unfortunately when I am trying to access it is stuck on jumping Grafana logo with "loading" inscription underneath it.
Grafana is expected to be accessible on subdomain like grafana.domain.com.
I've tried to change a config in both Nginx vhost and grafana.ini but with no luck. My current Nginx config:
server {
listen 80;
server_name grafana.domain.com;
return 301 https://$server_name$request_uri;
}
server {
listen *:443 ssl http2;
server_name grafana.domain.com;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_prefer_server_ciphers off;
resolver 1.1.1.1 8.8.8.8;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" always;
proxy_redirect off;
client_max_body_size 100M;
proxy_read_timeout 3000s;
proxy_send_timeout 3000s;
access_log /var/log/nginx/grafana-access.log;
error_log /var/log/nginx/grafana-error.log warn;
location / {
allow 1.2.3.4/32;
allow 2.3.4.5/29;
deny all;
proxy_ssl_verify off;
# proxy_redirect off;
# proxy_hide_header Upgrade;
proxy_set_header Host $http_host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-Host $host;
# proxy_set_header X-Forwarded-Server $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Server-Address $server_addr;
proxy_pass http://localhost:3000;
# proxy_http_version 1.1;
# proxy_cache_bypass $http_upgrade;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header X-Forwarded-Port $server_port;
}
}
I've also tried changing Grafana configuration to:
[server]
;protocol = http
;http_addr =
;http_port = 3000
domain = grafana.domain.com
;enforce_domain = false
root_url = %(protocol)s://%(domain)s:%(http_port)s/
serve_from_sub_path = true
but that doesn't work either.