Websocket Session Timeout

My problem is that the session timeout is not happening when using an Nginx reverse proxy, especially with HTTPS. Without the reverse proxy (using localhost), it works well. Is this issue related to Nginx or Moqui?

I did not change any default timeout configuration, and I do not want to change the default timeout, which is 60 minutes.

Or it be related to cookies handle? (Note: The same issue occurs when using Docker as well)

1 Like

Hmm, one possibility is that the websocket port is not exposed and / or properly handled by nginx. If it works properly on localhost then the websocket connection is established. However going over the wire you need to possibly wire ws:// to wss:// or something like that and redirect the ports accordingly

2 Likes

this is my nginx configuration, need to change or update ?

ssl_certificate /etc/ssl/certs/multi-domain.crt;
ssl_certificate_key /etc/ssl/private/multi-domain.key;

 map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

server {
        listen 443 ssl;
        server_name test1.integrines.com www.test1.integrines.com;
        location / {
                proxy_pass http://127.0.0.1:8080;
                proxy_ssl_name $host;
                proxy_set_header Host $host;
                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 $connection_upgrade;
                proxy_read_timeout 3600s;
                proxy_redirect off;
}
1 Like