Search code examples
vaadinvaadin7traefikrapidclipse

Vaadin app on Tomcat behind Traefik results in Session Expired


I have a small Vaadin/Rapidclipse app on a Tomcat server running. As reverse proxy I use Traefik v1.7.4. If I connect to the Server directly via http://159.69.121.213:8080/TestTraefik/ everything works fine.

http://159.69.121.213:8080/TestTraefik/ is public and you can test with it directly.

If I connect via the mycob.int.yyyy.com the site is loaded BUT it appears "Session Expired" immediately.

traefik.toml

################################################################
# Global configuration
################################################################
logLevel = "DEBUG"
defaultEntryPoints = ["http", "https"]
################################################################
# Entrypoints configuration
################################################################
[entryPoints]
    [entryPoints.http]
    address = ":80"
      [entryPoints.http.redirect]
        entryPoint = "https"
    [entryPoints.https]
    address = ":443"
      [entryPoints.https.tls]
        [[entryPoints.https.tls.certificates]]
          certFile = "/etc/letsencrypt/live/int.yyyy.com/fullchain.pem"
          keyFile = "/etc/letsencrypt/live/int.yyyy.com/privkey.pem"
[file]
filename = "./rules.toml"
watch = true
################################################################
# Traefik logs configuration
################################################################
[traefikLog]
 filePath = "log/traefik.log"
################################################################
# Access logs configuration
################################################################
[accessLog]
 filePath = "/path/to/log/log.txt"
################################################################

rules.toml

[frontends]
  [frontends.mycob2]
    entrypoints = ["https"]
    backend = "mycob"
    passHostHeader = true
    [frontends.mycob2.routes.all]
       rule = "Host:mycob.int.yyyy.com;AddPrefix:/TestTraefik"

[backends]
  [backends.mycob]
    [backends.mycob.servers.tomcat]
        url = "http://159.69.121.213:8080"

I can image the problem comes from the PUSH connection. In the post Session Expired on tomcat8 behind apache2 ProxyPass with Apache Proxy it seems that adding the ProxyPassReverseCookiePath brought the solution but I could not find such a option for Traefik.

Any idea what I do wrong?

Thank you in advance.


Solution

  • Ismail solved the issue for me. Thank you for that again.

    The problem was in /etc/tomcat/context.xml file of Tomcat.

    Adding sessionCookiePath="/" to the <Context> element solved the problem. Result line is <Context sessionCookiePath="/">.