Skip to content

Instantly share code, notes, and snippets.

@kylewin
Created May 11, 2024 10:05
Show Gist options
  • Save kylewin/dd40bae46b383403754ea48e77733e17 to your computer and use it in GitHub Desktop.
Save kylewin/dd40bae46b383403754ea48e77733e17 to your computer and use it in GitHub Desktop.
Grafana and Kibana behind Nginx subdomain

Grafana

To access with http://domain.com/grafana:

/etc/nginx/sites-available/default:
...
location /grafana {
    rewrite  ^/grafana/(.*)  /$1 break;
    proxy_set_header Host $host;
    proxy_pass http://localhost:3000;
}
/etc/grafana/grafana.ini:
domain = domain.name
root_url = %(protocol)s://%(domain)s/grafana/

Kibana

To access with http://domain.com/kibana:

/etc/nginx/sites-available/default:
...
location /kibana {
  proxy_pass http://localhost:5601;
}
/etc/kibana/kibana.yml:
server.basePath: "/kibana"
server.rewriteBasePath: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment