# Modifying destination backend in middleware plugin

**URL:** <https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902>\
**Category:** Traefik v2\
**Tags:** plugin\
**Created:** [December 23, 2022, 9:32am UTC](https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902 "2022-12-23T09:32:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pprishchepa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pprishchepa/32/6365_2.png) [@pprishchepa](https://community.traefik.io/u/pprishchepa)\
**Post date:** [December 23, 2022, 9:32am UTC](https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902/1 "2022-12-23T09:32:58Z")

</div>

I have a single entry point, many services and a complex logic of routing.

Are there any chance to switch a destination service in middleware plugin?

---

<div class="post-metadata">

**Author:** ![douglasdtm](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/douglasdtm/32/2002_2.png) [@douglasdtm](https://community.traefik.io/u/douglasdtm)\
**Post date:** [December 26, 2022, 1:46pm UTC](https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902/2 "2022-12-26T13:46:34Z")

</div>

Hi @pprishchepa this is not possible at all.  
This is a product design decision to never do routing in a middleware. Routing is exclusive to the router in Traefik which means you must declare multiple routers to handle different use cases, they can reference the same service but with different matching rules and middleware chain.

---

<div class="post-metadata">

**Author:** ![pprishchepa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/pprishchepa/32/6365_2.png) [@pprishchepa](https://community.traefik.io/u/pprishchepa)\
**Post date:** [January 10, 2023, 10:21am UTC](https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902/3 "2023-01-10T10:21:02Z")

</div>

@douglasdtm thank you for the clarification.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [January 13, 2023, 10:21am UTC](https://community.traefik.io/t/modifying-destination-backend-in-middleware-plugin/16902/4 "2023-01-13T10:21:18Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
