Edit:Websocket issues Pydio cells behind Nginx reverse proxy

I have Pydio Cells working, almost.
Running Cells on Ubuntu server IP .22
Running Nginx on Ubuntu server IP .21

Cells is accessible and can be logged into, from internal and external address.
Pages do not refresh, have to be triggered manually.
Websocket error:
WebSocket Closed Connection:The connection was closed abnormally, e.g., without sending or receiving a Close control frame (code 1006)
error during WebSocket handshake: Unexpected response code: 400
PydioComponents.min.js?v=504b856507275c435b16f7c46a2c1507:95 WebSocket is already in CLOSING or CLOSED state.

I am assuming that this has something to do with the /ws/ section in my nginx config, I’m just not sure.
Is there something I may have missed on the Cells server?

Here is a copy of the nginx config if anyone has any suggestions. Thanks in advance


upstream pydiolinux {
server x.x.x.21:8080;
server x.x.x.21:443;

}
upstream websocket{
server x.x.x.21:8080;
server x.x.x.0.21:443;

}
server {
listen 443;
ssl on;

listen 443 ssl # managed by Certbot

ssl_certificate /etc/letsencrypt/live/my.server.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my.server.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

#Had to add this Manually
ssl_protocols TLSv1.2 TLSv1.3;

    server_name my.server.com;

#Added the Client max body size manually, and the real ip line, and turned buffering off

client_max_body_size 10G;
    location / {
       proxy_pass http://x.x.x.21:8080$request_uri;
       proxy_pass_request_headers on;
       proxy_set_header Host $host;
       proxy_set_header X-real-IP $remote_addr;
       grpc_pass grpcs://x.x.x.21:8080;
       proxy_buffering off;
       proxy_http_version 1.1;
      # proxy_set_header X-Real-IP $remote_address;
      # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 }

   location /ws/ {
    proxy_pass  http://x.x.x:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
   # Remove if not working
    proxy_set_header Host $host;
    proxy_read_timeout 86400s;
    proxy_send_timeout 86400;
}

}

error_log /var/log/nginx/cells-proxy-error.log;
access_log /var/log/nginx/cells-proxy-access.log;

server {
if ($host = my.server.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 443 ssl http2;
listen 80;
listen [::]:80;

    server_name my.server.com;
return 404; # managed by Certbot

}

Hello @dagodad ,

I have a new update about the nginx config, it is about the grpc_pass,
could you replace it with the following

    if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://cells:8080;
        }

Now onto your websocket issue, i’m not an expert on reverse proxies but I currently am running a setup with nginx and I do not have the refresh issue, could you try with my config (it is simpler)

server {

    server_name my-cells.eu`;

    # To allow special characters in headers
    # ignore_invalid_headers off;

    # Allow any size file to be uploaded.
    # Set to a value such as 1000m; to restrict file size to a specific value
    client_max_body_size 0;
    # To disable buffering
    proxy_buffering off;


    location / {
        if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://cells:8080;
        }
        proxy_pass https://cells:8080;
    }


    location /ws/ {
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass https://cells:8080;
        proxy_read_timeout 86400;
    }

    location /minio/ {
        proxy_pass http://minio:9003/;
    }

    # error_log stderr;
    # access_log /var/log/nginx/cells-proxy-access.log;

    listen [::]:7070 ssl;
    listen 7070 ssl http2;
    ssl_certificate /etc/letsencrypt/live/my-cells.eu/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/my-cells.eu/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = my-cells.eu) {
        return 301 https://$host$request_uri;
    }


    listen 80;
    listen [::]:80;
    server_name my-cells.eu;
    return 404;
}

If you still see the issue, it might be something specific about your network,
could you give me a description of your setup.