Tweak the response using middleware to redirect to a different endpoint

Hey Guys,

I'm not sure if this is possible using middlewares. I would like to redirect to an endpoint eg. xyz.com before answer from the services are sent to the clients. Based on the docs here, specifically this line

Attached to the routers, pieces of middleware are a means of tweaking the requests before they are sent to your service (or before the answer from the services are sent to the clients)

I assume this is possible using middlewares but i couldn't find any examples on how to do it. The only thing that i found was to tweak requests from clients to services and this works fine for me.

Here's how the flow is wired and what i'm looking for -

Request flow:
Client --> Application load balancer--> Target group --> ingress route --> my auth --> Jupyterhub

Response flow ( currently existing ):
Jupyterhub ( client clicks on logout ) --> Application loadbalancer --> Target group --> ingressroute --> my auth --- client is able to see my auth page.

Response flow ( what i'm looking for ):
Jupyterhub ( client clicks on logout ) --> Application loadbalancer --> Target group --> ingressroute --> my auth service --> middleware ( redirection ) --> https://xyz.com -- client should see xyz.com now.

Running traefik pods in EKSv1.17, traefik version 2.3.0

Please let me know if there are any examples on how this can be tweaked or if i have to follow any plugins?

Appreciate your help.

Thanks.

I'm having a similar issue. Were you able to get this done?

Nope not yet. Hey @SantoDE, @kevinpollet could you guys help pointing us in right direction on how this can be achieved.

Thanks.