If you’re reading this you probably have multiple instances of your services running on docker containers and wondering how to balance the traffic between them.

For the sake of simplicity am going to assume that you have a ubuntu server running with docker installed and running Containers A and B

Let’s look at the options we have to solve this problem:

Option 1

With Nginx installed on the host machine

Like so:

Serving react front ends can be done in many ways, depending on your needs, but one effective way of doing it, if for sure using nginx, so stick with me

The way you might be doing it right now is using your rest api (express / rails), but this puts unwanted weight and traffic on your api, instead what we could do is seperate the serving of the front-end from the back-end.

Mohamed Belkamel

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store