Nginx reverse proxy with SSL leads to failed to load application files

Hi everyone, I’ve been trying to set up Grafana 6.3.5 to run on my server in a different domain using Nginx but I just can’t get it to work. I’ve spent so many hours trying to get this working it’s starting to drive me nuts.

I’ve installed Grafana and it works by default from the servers IP address and domain at

but I want to run it from a different domain on the same server at

This server has multiple Nginx configurations running multiple different domains, so I assume this shouldn’t be a problem since Nginx handles the traffic anyway and it works with other setups running python the same way.


server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        root /var/www/;

        # SSL
        ssl_certificate /etc/letsencrypt/live/;
        ssl_certificate_key /etc/letsencrypt/live/;
        ssl_trusted_certificate /etc/letsencrypt/live/;

        # security
#       include;

        # logging
        error_log /var/log/nginx/ warn;

        # reverse proxy
        location / {
                proxy_pass http://localhost:3000;

        # additional config

# HTTP redirect
server {
        listen 80;
        listen [::]:80;



        location / {
                return 301$request_uri;

note: I’ve disabled the security to see if it has any effect on results. Nginx base config is Generated using


# Protocol (http, https, socket)
;protocol = http

# The ip address to bind to, empty will bind to all interfaces
;http_addr =

# The http port  to use
;http_port = 3000

# The public facing domain name used to access grafana from a browser
domain =

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = false

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
;root_url = http://localhost:3000

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false

Based on the tutorial I’ve only changed the domain and it should work but it results in

**If you're seeing this Grafana has failed to load its application files**  

1. This could be caused by your reverse proxy settings.

2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath

3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build

4. Sometimes restarting grafana-server can help

I’ve also tried a ton of other combinations I could find from both Nginx and Grafana’s side but none of them work any better.

for example I’ve tried to change root_url = and root_url = with sub path enabled. I’ve also tried things like enabling most of the options and using wildcards like %(protocol)s://%(domain)s:%(http_port)s but none of these made any difference.

When checking the status of grafana it also points out that the config file is read from /etc/grafana/grafana.ini so it should be correct.

Any ideas how to get this to work?

You need to set root_url =

Yeah I tried that one too, unfortunately it doesn’t work

I have solved the issue, but I’m not sure if it is the correct solution.

The problem was caused by the root path in Nginx settings, I didn’t expect this actually to affect Grafana but act more like a fallback directory if the service is not running.

I changed this
root /var/www/;
root /usr/share/grafana/;

so now it can find the files it’s looking for and works as expected.

1 Like