Important: for docker 24+ use latest portainer image (2.20.3+)
To connect shell into containers, portainer nginx config must be updated on location
block:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600;