[PR] Run grafana behind nginx: fail to load grafana if cache policy exists
BennyThink opened this issue · comments
Benny commented
Hi!
I just find an interesting problem.
If I have js/css cache policy in Nginx, the directives on your website will result in 404
For example, If my nginx settings are
location ~ .*\.(js|css|woff)?$ {
expires 30d;
}
location /grafana/ {
proxy_pass http://localhost:3000/;
}
Grafana will always failed to load because the priority of location ~
is higher than location /grafana/
It will fail as long we have location ~
.
A simple solution is change location /grafana/
to location ~/grafana/
and make it as the first location block.
I've created a PR for this.
Reference: Nginx location priority
Benny commented
Merged and closed