why no just pass the $http_upgrade and $http_connection headers to the backend? like conf bellow:
proxy_set_header Upgrade $http_upgrade
proxy_set_header Connection $http_Connection
and if i set the Connection header to "upgrade" permanently, does it make any harm?