Hi all,
I am after some advice on best way to achieve the following.
We will have several droplets, each created from the market place ‘Docker’ image and each will have a service running from a docker container on different port numbers (see below).
Droplet 1
localhost:8017
localhost:9017
Droplet 2
localhost:8018
localhost:9018
…what I was hoping to achieve was to have another droplet, running something like Nginx (open to recommendations), to forward all traffic for each domain to the relevant service droplet and port number.
forwardingDroplet port 443
service1.domain.com forwards to droplet 1 on port 8017
service1-sandbox.domain.com forwards to droplet 1 on port 9017
service2.domain.com forwards to droplet 2 on port 8018
service2-sandbox.domain.com forwards to droplet 2 on port 9018
…this forwarding/reverse proxy droplet would also need to, ideally, manage Lets Encrypt certificates.
I currently have each droplet running Nginx locally with reverse proxy in place, but interested in how the above could be implemented so we only have one droplet directly public facing and one place to manage the forwarding/reverse proxy.
Any advice/input greatly appreciated, K…
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
Indeed, Nginx sounds like a good option.
What you could do is to setup an Nginx server block for each of your domain names with the corresponding reverse proxy rules.
For example:
/etc/nginx/sites-available/service1.domain.com
:/etc/nginx/sites-available/service2.domain.com
:And so on for each domain name.
Then you could use Let’s Encrypt to issue a certificate for your domains.
You should be able to also achieve this without the need of a separate Nginx Droplet, you could have the same result with the Nginx installed on the Droplets where you’ve deployed your apps on.
Let me know how it goes and let me know if you have any questions!
Best,
Bobby