I am trying to run 2 applications behind an NGINX server.
one is listening on 3000 (grafana) and one is listening on 9090 (prometheus)
My current server block nginx.conf looks like this:
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
proxy_pass http://localhost:3000/;
}
location /prometheus{
proxy_pass http://localhost:9090/;
}
}
Now for Grafana, this works perfectly and everything works in the dashboard.
But when typing Domain/prometheus it still redirects me to grafana instead of Prometheus.
Do I need todo something specific to have it working in this setup that everything besides /prometheus is redirected to grafana?
2
Answers
So I solved it now by doing this:
By default,
http://localhost:9090
will be redirected tohttp://localhost:9090/graph
, so the request is being redirected as below:You can check this by using F12 in Chrome.
To fix this, I recommend you separate the domain into two domains: