Issue with mobile view and websocket

  • Used Zammad version: 6.2.0-1708586921.9bcc425e.bookworm
  • Used Zammad installation type: package
  • Operating system: Debian 12
  • Browser + version: Brave 1.63.165

Expected behavior:

Mobile version of the website to work

Actual behavior:

For clarification: local URL is the one on our network,
Full URL is the one accessible from everywhere, behind our revproxy

Our setup is a website with a local URL behind an nginx revproxy, so zammad is configured for http.

I get an error when going to the mobile view of the website, “The connection to the server was lost”, and in the logs i see “WebSocket connection to ‘ws://192.168.102.x/ cable’ failed:”. (Because of this error, just like others have had before, i can’t respond to tickets)

When changing the FQDN to the local URL, i can access the mobile view by connecting directly to it’s local URL, and have no issue responding to tickets, but it still doesn’t work when using the full URL.
When changing the FQDN to the full url (with no caps), it never works.
Actually, i managed to have it working with full URL as FQDN and by connecting to local URL (still not with full URL), but i had to add in /opt/zammad/config/initializers/action_cable_preferences.rb the following line: Rails.application.config.action_cable.allowed_request_origins = [‘http:// 192.168.102.x’]

I tried adding the full URL too, but it didn’t work.

I know i’m not the only one with this issue but nothing i’ve found online seem to work.

This is a clean install of Zammad 6.2 on a completely new VM, i didn’t update anything.

In production.log i can see the following error:

Summary

I, [2024-03-06T17:22:15.529758#26958-142000] INFO – : Started GET “/cable” for 192.168.102.x2 at 2024-03-06 17:22:15 +0100
I, [2024-03-06T17:22:15.557063#26958-142000] INFO – : Started GET “/cable” [WebSocket] for 192.168.102.x2 at 2024-03-06 17:22:15 +0100
E, [2024-03-06T17:22:15.557142#26958-142000] ERROR – : Request origin not allowed: http:// 192.168.102.x
E, [2024-03-06T17:22:15.557177#26958-142000] ERROR – : Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)

(The 192.168.102.x2 adress is different from 192.168.102.x)

Here is part of the config for my website in our nginx revProxy:

Summary

location / {
proxy_pass http:// 192.168.102.x/;
}

    location /cable  {
            proxy_pass http:// 192.168.102.x/;

            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
	proxy_set_header CLIENT_IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
    }

Steps to reproduce the behavior:

Try accessing the mobile version of the website.

Hi @AArbey. The documentation contains all needed information.

Hey!
First of all thanks for the quick reply.
I’m quite new to this but correct me if i’m wrong, in the guide you sent me (which i already followed), i have to configure it for HTTP, not https since we’re behind a revproxy and don’t use https in our local network. Therefore, the configuration is pretty straightforwad, yet it still doesn’t work for me.

I solved the issue, it was actually much simpler than i thought.
First i had to change the http type to https, afterwards i had the CSRF token error.

To fix this issue, i had to replace the http type in the nginx config file for the website, forcing it to https. Here are the lines i changed:

proxy_set_header X-Forwarded-Proto https;

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.