I am trying to add a load balancer to my stack. Basically I have a stack made out of a Python application, RabbitMQ queue, Redis DB and Nginx which acts as a reverse proxy for the Python server. There are some independent workers which connect to the queue and fetch jobs but they are not important here because I scale them manually on new physical hosts.
If I add the Nginx proxy as the first service and the rest as sidekicks (because I read that only the first main service can be load balanced and not the sidekicks), I have trouble starting the stack because Nginx waits for the upstream server to start but since the Python app is defined as as sidekick it won’t start first.
Is this the intended behaviour or is my train of thought wrong? From my understanding I thought I’d need to set up the stack in such a way that all services are linked together because I want to deploy them on the same physical machine. Then with a load balancer I would duplicate my stack and have the balancer rely the incoming requests to each stack in turn on different machines.
Thanks