# Routing to a specific node in Docker Swarm

**URL:** <https://community.traefik.io/t/routing-to-a-specific-node-in-docker-swarm/14047>\
**Category:** Traefik v2\
**Tags:** docker, docker-swarm\
**Created:** [April 5, 2022, 2:24pm UTC](https://community.traefik.io/t/routing-to-a-specific-node-in-docker-swarm/14047 "2022-04-05T14:24:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WestRider](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@WestRider](https://community.traefik.io/u/WestRider)\
**Post date:** [April 5, 2022, 2:24pm UTC](https://community.traefik.io/t/routing-to-a-specific-node-in-docker-swarm/14047/1 "2022-04-05T14:24:26Z")

</div>

Hi there,

I have been looking through the docs and forums and have had no luck finding the answer to this.

I am running a global service in a Docker Stack (so 1 application per node), however, is there a way to create routes to a specific node running that service?

For example, a NodeJS application is running on node1, node2, node3.  
Is there a way to create these routes?

- [test.com/node1/](http://test.com/node1/)...
- [test.com/node2/](http://test.com/node2/)...
- [test.com/node3/](http://test.com/node3/)...

Thanks for your time 🙂

---

<div class="post-metadata">

**Author:** ![jakubhajek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jakubhajek/32/3389_2.png) [@jakubhajek](https://community.traefik.io/u/jakubhajek)\
**Post date:** [April 6, 2022, 9:48am UTC](https://community.traefik.io/t/routing-to-a-specific-node-in-docker-swarm/14047/2 "2022-04-06T09:48:28Z")

</div>

Hello @WestRider

Thanks for using Traefik and joining our community.

I don't think that it is possible to create a routing rule that will reach a particular node. However, I would deploy a service using [node constraints](https://docs.docker.com/engine/swarm/services/#placement-constraints) and then create a routing rule based on [Host and Path matchers.](https://doc.traefik.io/traefik/routing/routers/#rule)

What do you think about that approach?

---

<div class="post-metadata">

**Author:** ![WestRider](https://avatars.discourse-cdn.com/v4/letter/w/dec6dc/32.png) [@WestRider](https://community.traefik.io/u/WestRider)\
**Post date:** [April 6, 2022, 10:39am UTC](https://community.traefik.io/t/routing-to-a-specific-node-in-docker-swarm/14047/3 "2022-04-06T10:39:42Z")

</div>

Hi @jakubhajek

Thanks for the reply, I was thinking about doing that but hoped there was a more automated process. Since, the service is already constrained to a label that is shared across the suitable nodes, so was hoping there was a special variable I could put in the Host rule that would fill that in.

But will give the individual service per node a go, and try make use of YAML anchors so I only have to change the traefik labels per service 🙂

Thanks
