I have a localserver on which port 80 is open and serving nginx. I have kibana service running in port 5601 and portainer running in 9443
The following nginx.conf works and I can access kibana by going to http://localhost:
{
listen 80;
server_name localhost 127.0.0.1;
location /
{
proxy_pass http://kibana:5601;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
The following nginx.conf works as well and I can reach portainer by going to https://localhost
{
listen 80;
server_name localhost 127.0.0.1;
location /
{
proxy_pass https://portainer:9443;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
However if I were to put these two location on a single server (single conf like below I can only reach the Kibana and Portainer not working.
{
listen 80;
server_name localhost 127.0.0.1;
location /kibana
{
proxy_pass http://kibana:5601;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /portainer
{
proxy_pass https://portainer:9443;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
How can I merge these two locations in single server on port 80 and access both the services by going to
Portainer: https://localhost/portainer
Kibana: http://localhost/kibana
Any suggestions?