Search code examples
dockernginxdocker-swarm

How to do nginx reverse proxy to docker services app created in docker swarm?


I've one question regarding docker swarm

I've created 2 services(app1,app2) using docker service in swarm manager

Let's say I want to point the following subdomain to respective service

app1.domain.com >> app1

app2.domain.com >> app2

I've tried below one library for nginx proxy but I think it only works with docker container, not with docker service

https://blog.florianlopes.io/host-multiple-websites-on-sin…/


Solution

  • You'll need to run an application to handle this; the two most popular solutions seem to be:

    Or - if you're in AWS; you can use an Application Load Balancer as well.

    There is no native solution for this in Docker - you need to run one of these (Or another solution to accomplish the same feat)