Question

Docker droplet image from market place - do I need nginx to resolve domain name to docker site?

So I have created a droplet from the docker image on marketplace and have my site docker instance cloned, built and up.

In order for my domain (sub domains) to point a specific service on my docker instance, do I ‘need’ to use nginx?

Assuming I do; does anybody know a decent (up to date) tutorial to show me how to achieve this, please? I have a production and a sandbox subdomain that needs to point to relevant services on my docker instance (already pointing to DO nameservers).

I also now have an nginx docker instance setup and running.

From this point I have found several ways to use nginx to point each subdomain to the relevant port number on a docker instance (using port 8017 and 9017, respectively), but am confused by the number of options/choices to achieve this goal!

I am most likely over thinking it, but any pointers would be greatly appreciated.

k…


Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
January 5, 2023

Hi there,

Indeed you can use Nginx as a reverse proxy. Here is a quick tutorial on how to set that up:

https://www.digitalocean.com/community/questions/how-to-host-multiple-docker-containers-on-a-single-droplet-with-nginx-reverse-proxy

Keep in mind that the exact Nginx rules that you would need to use in your Nginx config file would depend on the framework that you are using. Feel free to share more details about the Docker containers and the services that you are running inside them and I can give you more details on what rules you need to add to the Nginx server blocks.

Let me know how it goes!

Best,

Bobby