We had many applications on single vultr cloud instance, but it has only one default healthcheck for a single https loadBalancer with SSL certificate.
so we used nginx to configure mutliple /backend URL with http specified and running using docker-compose to make applications running on a single network.
server {
listen 80;
listen [::]:80;
server_name *.example.com;
access_log /var/log/nginx/host.access.log main;
location / {
proxy_pass http://strapi-container:1337/;
}
location /chat {
proxy_pass http://rocketchat-container:3000;
}
location /auth {
proxy_pass http://keycloak-container:8080;
proxy_set_header Host $host;
}
}
}
The backend url is http://instance-ip/, http://instance-ip/chat, http://instance-ip/auth respectively
nginx:
image: nginx:1.20
container_name: nginx
ports:
- 80:80
restart: unless-stopped
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- strapi-cms
- rocketchat
- keycloak
networks:
- test-network
Everything works fine and we are able to access the applications through nginx default port 80 with the above backend URL's.
But our intentions is to somehow connect the nginx with HTTPS LoadBalancer in vultr, it should works as
For example: https://qa.example.com/, https://qa.example.com/chat, https://qa.example.com/auth