Sticky session with Tomcat jvmroute

Guys, I'm having a hard time implementing a Load Balancer Traefik V2 with serving as a proxy for Tomcat with sticky session.

Currently my application already works partially with the following settings:

        - traefik.enable=true
        - traefik.http.routers.tomcat.rule=Host(``) && PathPrefix(`/mypath/`)
        - traefik.http.routers.tomcat.service=tomcat
        - traefik.http.routers.tomcat.entrypoints=web

From then on I can't access my application, and from then on new problems arise.

My application is not configured to lose the session when refreshing the page and whenever I do this the session is destroyed using Traefik's LB.

My second problem is that some of my requests end up going to other containers in the cluster and this prevents me from running some tasks in the application, especially those that I consult an external service.

Ex: I use an external service to generate reports and the request for this service within the application is changed container and I cannot generate the report.

See that my access container is ""

[t29s5 ]( - - [11/Oct/2021:02:54:02 +0000] "POST /webrun/ HTTP/1.1" 200 63 "-" "-" 795 "tomcat@docker" "" 31ms

nd now he walks between two different containers. "" and "" thus having error 500 Internal Server Error

[t29s5 ]( - - [11/Oct/2021:02:55:28 +0000] "GET /webrun/download?id=A60E20F2-64D7-454E-8FB3-F95275A7EB9E&hash=911119621632346077000&name=PM_Juazeiro&jsessionid=F8BA71714A6BDB1C0C0C8A7E72D584D5 HTTP/1.0" 500 383 "-" "-" 811 "tomcat@docker" "" 12ms

[t7znc ]( - - [11/Oct/2021:02:55:29 +0000] "GET /webrun/download?id=A60E20F2-64D7-454E-8FB3-F95275A7EB9E&hash=911119621632346077000&name=PM_Juazeiro&jsessionid=F8BA71714A6BDB1C0C0C8A7E72D584D5 HTTP/1.0" 500 383 "-" "-" 633 "tomcat@docker" "" 2406ms

In other providers like Apache2 and NGINX I can work this normally, however I use Tomcat's jvmRoute. So I'm in doubt if there would be this possibility of Traefik or if there would be another solution to my problem.

Greetings from Brazil!!

Guys, I ended up opening a problem on github too, if you want to follow up.

Guys, I could see that whenever I call a download within my context, the traefik is lost.

As I use sticky sessions this download is never called by the same container where the client is connected and I see no reason for traefik to do this.

Everything works very normal except when I need to download any file.