Hey there,
I’m currently setting up a Grafana Dashboard next to a Wordpress installation on one of my servers. I tried around the whole day to set it up and I’m still stuck at the first page with the message " If you’re seeing this Grafana has failed to load its application files". None of the js files can be loaded, they all throw an ERR_ABORTED 404 Error.
I use Ubuntu 18.04.3.
Does anyone have any idea?
Some Details:
This is the output of the grafana log:
t=2020-08-25T16:39:12+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=162.158.94.110 time_ms=0 size=37 referer=
This is the only area in the grafana.ini where I changed things. (I removed the comments here to make it more readable)
;protocol = http
;http_addr =
http_port = 3005
domain = MYDOMAIN
;enforce_domain = false
root_url = https://MYDOMAIN/grafana
serve_from_sub_path = true
Log web requests
;router_logging = false
;static_root_path = public
;enable_gzip = false
;cert_file =
;cert_key =
;socket =
And this is my nginx configuration. The grafana specific definition is at the bottom.
# Redirect HTTP -> HTTPS
server {
listen 80;
server_name www.MYDOMAIN MYDOMAIN;
#include snippets/letsencrypt.conf;
return 301 https://MYDOMAIN$request_uri;
}
# Redirect WWW -> NON WWW
server {
listen 443 ssl http2;
server_name www.MYDOMAIN;
ssl_certificate /etc/letsencrypt/live/MYDOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/MYDOMAIN/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/MYDOMAIN/chain.pem;
#include snippets/ssl.conf;
return 301 https://MYDOMAIN$request_uri;
}
server {
listen 443 ssl http2;
server_name MYDOMAIN;
root /var/www/html/MYDOMAIN;
index index.php;
# SSL parameters
ssl_certificate /etc/letsencrypt/live/MYDOMAIN/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/MYDOMAIN/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/MYDOMAIN/chain.pem;
#include snippets/ssl.conf;
#include snippets/letsencrypt.conf;
# log files
access_log /var/log/nginx/MYDOMAIN.access.log;
error_log /var/log/nginx/MYDOMAIN.error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires max;
log_not_found off;
}
location /api/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://grafana.staged-by-discourse.com/;
proxy_redirect off;
proxy_read_timeout 240s;
}
location /grafana/ {
proxy_set_header Host $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_pass http://localhost:3005/;
}
}