CORS issues behind nginx ingress after updating to JupyterHub 2.1.1

There is indeed a load balancer in front of the nginx. Here’s my attempt to obtain some debug logging (as instructed here: Troubleshooting - NGINX Ingress Controller with --v=5) after trying to stop my server

2022/03/14 22:44:20 [debug] 39#39: *16329 http uri: "/hub/api/users/konstantin.taletskiy@labshare.org/server"
2022/03/14 22:44:20 [debug] 39#39: *16329 http args: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http exten: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 posix_memalign: 00005561715FA1A0:4096 @16
2022/03/14 22:44:20 [debug] 39#39: *16329 http process request header line
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Host: <redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Connection: keep-alive"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "sec-ch-ua: "Microsoft Edge";v="95", "Chromium";v="95", ";Not A Brand";v="99""
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Accept: */*"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Content-Type: application/json"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "X-Requested-With: XMLHttpRequest"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "sec-ch-ua-mobile: ?0"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "sec-ch-ua-platform: "macOS""
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Origin: https://<redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Sec-Fetch-Site: same-origin"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Sec-Fetch-Mode: cors"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Sec-Fetch-Dest: empty"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Referer: https://<redacted_url>/hub/home"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Accept-Encoding: gzip, deflate, br"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Accept-Language: en-US,en;q=0.9"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header: "Cookie: jupyterhub-hub-login="<redacted>"; jupyterhub-session-id=<redacted>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http header done
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 0
2022/03/14 22:44:20 [debug] 39#39: *16329 rewrite phase: 1
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "-"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $proxy_upstream_name
2022/03/14 22:44:20 [debug] 39#39: *16329 test location: "/"
2022/03/14 22:44:20 [debug] 39#39: *16329 using configuration "/"
2022/03/14 22:44:20 [debug] 39#39: *16329 http cl:-1 max:0
2022/03/14 22:44:20 [debug] 39#39: *16329 rewrite phase: 3
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "<jupyterhub_namespace>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $namespace
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "<helm_deployment_full_name>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $ingress_name
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "jupyterhub"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $service_name
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "80"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $service_port
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "/"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $location_path
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "-1"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $balancer_ewma_score
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: "<k8s_namespace-service_name-port>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $proxy_upstream_name
2022/03/14 22:44:20 [debug] 39#39: *16329 http script complex value
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<k8s_namespace-service_name-port>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $proxy_host
2022/03/14 22:44:20 [debug] 39#39: *16329 http script complex value
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "http"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $pass_access_scheme
2022/03/14 22:44:20 [debug] 39#39: *16329 http script complex value
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "80"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $pass_server_port
2022/03/14 22:44:20 [debug] 39#39: *16329 http script complex value
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $best_http_host
2022/03/14 22:44:20 [debug] 39#39: *16329 http script complex value
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "80"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $pass_port
2022/03/14 22:44:20 [debug] 39#39: *16329 http script value: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http script set $proxy_alternative_upstream_name
2022/03/14 22:44:20 [debug] 39#39: *16329 rewrite phase: 4
2022/03/14 22:44:20 [debug] 39#39: *16329 lua rewrite handler, uri:"/hub/api/users/konstantin.taletskiy@labshare.org/server" c:1
2022/03/14 22:44:20 [debug] 39#39: *16329 looking up Lua code cache with key '=rewrite_by_lua(nginx.conf:1255)nhli_810dc96928b7314c9cd60e7b526c7375'
2022/03/14 22:44:20 [debug] 39#39: *16329 lua creating new thread
2022/03/14 22:44:20 [debug] 39#39: *16329 lua reset ctx
2022/03/14 22:44:20 [debug] 39#39: *16329 http cleanup add: 00005561715FA990
2022/03/14 22:44:20 [debug] 39#39: *16329 lua run thread, top:0 c:1
2022/03/14 22:44:20 [debug] 39#39: *16329 add cleanup: 00005561715FAA08
2022/03/14 22:44:20 [debug] 39#39: *16329 lua resume returned 0
2022/03/14 22:44:20 [debug] 39#39: *16329 lua light thread ended normally
2022/03/14 22:44:20 [debug] 39#39: *16329 lua deleting light thread
2022/03/14 22:44:20 [debug] 39#39: *16329 rewrite phase: 5
2022/03/14 22:44:20 [debug] 39#39: *16329 headers more rewrite handler, uri "/hub/api/users/konstantin.taletskiy@labshare.org/server"
2022/03/14 22:44:20 [debug] 39#39: *16329 post rewrite phase: 6
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 7
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 8
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 9
2022/03/14 22:44:20 [debug] 39#39: *16329 access phase: 10
2022/03/14 22:44:20 [debug] 39#39: *16329 access phase: 11
2022/03/14 22:44:20 [debug] 39#39: *16329 access phase: 12
2022/03/14 22:44:20 [debug] 39#39: *16329 access phase: 13
2022/03/14 22:44:20 [debug] 39#39: *16329 post access phase: 14
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 15
2022/03/14 22:44:20 [debug] 39#39: *16329 generic phase: 16
2022/03/14 22:44:20 [debug] 39#39: *16329 http init upstream, client timer: 0
2022/03/14 22:44:20 [debug] 39#39: *16329 http map started
2022/03/14 22:44:20 [debug] 39#39: *16329 http map: "" ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http map started
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<redacted>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http map: "" "<redacted>"
2022/03/14 22:44:20 [debug] 39#39: *16329 posix_memalign: 00005561715FC400:4096 @16
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "Host"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Request-ID"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<redacted>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Real-IP"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "192.168.3.68"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Forwarded-For"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "192.168.3.68"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Forwarded-Host"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "<redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Forwarded-Port"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "80"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Forwarded-Proto"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "http"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: "X-Scheme"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script var: "http"
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http script copy: ""
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "sec-ch-ua: "Microsoft Edge";v="95", "Chromium";v="95", ";Not A Brand";v="99""
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Accept: */*"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Content-Type: application/json"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "X-Requested-With: XMLHttpRequest"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "sec-ch-ua-mobile: ?0"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "sec-ch-ua-platform: "macOS""
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Origin: https://<redacted_url>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Sec-Fetch-Site: same-origin"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Sec-Fetch-Mode: cors"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Sec-Fetch-Dest: empty"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Referer: https://<redacted_url>/hub/home"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Accept-Encoding: gzip, deflate, br"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Accept-Language: en-US,en;q=0.9"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header: "Cookie: jupyterhub-hub-login="<redacted>"; jupyterhub-session-id=<redacted>"
2022/03/14 22:44:20 [debug] 39#39: *16329 http proxy header:
"DELETE /hub/api/users/konstantin.taletskiy%40labshare.org/server HTTP/1.1
Host: <redacted_url>
X-Request-ID: <redacted>
X-Real-IP: 192.168.3.68
X-Forwarded-For: 192.168.3.68
X-Forwarded-Host: <redacted_url>
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Scheme: http
sec-ch-ua: "Microsoft Edge";v="95", "Chromium";v="95", ";Not A Brand";v="99"
Accept: */*
Content-Type: application/json
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53
sec-ch-ua-platform: "macOS"
Origin: https://<redacted_url>
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://<redacted_url>/hub/home
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: jupyterhub-hub-login="<redacted>"; jupyterhub-session-id=<redacted>

"