grafana.ini
[server]
domain = example.com
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
serve_from_sub_path = true
nginx.conf
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
location /grafana {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://grafana:3000;
}
}
Note: DO NOT add the trailing slash “/” at the end of the “proxy_pass”.