Using Session Affinity (Cookies) with SSL Passthrough on NGINX-Ingress Using Session Affinity (Cookies) with SSL Passthrough on NGINX-Ingress kubernetes kubernetes

Using Session Affinity (Cookies) with SSL Passthrough on NGINX-Ingress


Short answer: no it's impossible. Layer 4 has no clue on what http is, it just sees bytes flowing back and forth. You could have affinity based on ip address instead, just not with cookies as it would need a layer 7 proxy solution. Depending on your situation, you could run a proxy in layer 7 which would be able to decrypt the traffic and then encrypt it with another certificate for internal use. All of the payload (minus SNI for example) is not encrypted as per SSL, which means that in order to do some kind of affinity on cookies, the proxy will need to decrypt the data before inspecting it.