Http2, Websockets and SSOwat (Cockpit)

Hi there,
I’m trying to make Cockpit ( work, with plans to propose this as a Ynh app.
Currently, I’m not able to make websockets work through Nginx.

My nginx config file is :

rewrite ^/cockpit$ /cockpit/ permanent;

location /cockpit/ {

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # Required for web sockets to function
    proxy_http_version 1.1;
    proxy_buffering off;
    proxy_set_header Upgrade websocket;
    proxy_set_header Connection "Upgrade";

    # Pass ETag header from Cockpit to clients.
    # See:
    gzip off;

    # Include SSOWAT user panel.
    # include conf.d/;

My request url : wss://

Any clue ?

Have you look into the browser console ?

Also there’s an existing package though no idea in what state it is …

Thanks for pointing out the (non-working) existing app. I should’ve read in more details the nginx conf. Looks like I was just missing one line :

proxy_set_header Origin http://$host;

Now it’s working !
I may do a PR to the existing app soon or later this week.

1 Like