Score:0

open-source ngnix reverse proxy for tomcat servers session persistence with JSESSIONID?

cn flag

I am tasked with converting (or attempting to convert) some legacy Apache virtual host configuration to Nginx, in Google Cloud (GCP). It is thought that Nginx might solve some performance issues. The ngnix (Debian11) VM will sit in front of (replacing the Apache in LB role) several Tomcat servers (Debian10) and perform reverse-proxy and load-balancer functions. In the legacy Apache LB configuration, the Tomcat servers are configured in a <Proxy balancer://tomcat> stanza, as such:

        BalancerMember ajp://10.10.184.4:8009 route=backend-server-1
... (additional tomcat servers)...
        ProxySet stickysession=JSESSIONID

As I understand it, the open-source Nginx (I will not have access to Ngix Plus) does not have the same JSESSIONID options that Nginx Plus has: https://docs.nginx.com/nginx/deployment-guides/load-balance-third-party/apache-tomcat/

So, with Nginx open-source, what is the best way I can attempt to mimic this Apache configuration, in my "upstream" block? My current MVP configuration looks like this:

(the Nginx documentation says that "ip hash" will result in session persistence, but this Apache configuration seems pretty reliant on the JSESSIONID)

upstream tomcat {
    # Use IP Hash for session persistence
    ip_hash;
    # List of Tomcat application servers
     server 10.10.184.2:8009;
     server 10.10.184.3:8009;
     server 10.10.184.4:8009;
    
}
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.