VScode server running in a docker container and Error: WebSocket close with status code 1006)

Hi all,
I have two docker container.

A vscode container and a nginx container that acts as a reverse proxy to add SSL to every websites running on various containers.

I would like to do the same with vscode but it seems that there are some problems with the websocket reverse proxy.

I have a rule like this:

upstream websocket {
server 192.168.1.2:8443;
}

server {
listen 8444 ssl;
server_name mydns

location / {
    proxy_pass http://192.168.1.2:8443/; #YOUR Address and Port of HA
    proxy_set_header Host $host;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header Accept-Encoding gzip;
}

ssl_certificate /etc/letsencrypt/live/mydns/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydns/privkey.pem;

include /etc/letsencrypt/options-ssl-nginx.conf;    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

}

but I get this error.

An unexpected error occurred that requires a reload of this page.
The workbench failed to connect to the server (Error: WebSocket close with status code 1006)

any help would be really appreciated.

Delayed posting as your post got caught by our approval system (unsure why).

As mentioned in discord ( Discord ) You need to configure your nginx proxy to handle websockets.

Our SWAG solution does so out the box GitHub - linuxserver/docker-swag: Nginx webserver and reverse proxy with php support and a built-in Certbot (Let's Encrypt) client. It also contains fail2ban for intrusion prevention.

I would like to switch on swag but I can’t find any guide that helps me in this transition…
Is there someone who used SWAG to access Home Assistant from SSL using something like Let’s Encrypt?

No need to transition, just start fresh: