[howto] Zammad 6.0 mobile with Docker installs

I stumbled over the same issue with the “The connection to the server was lost.” error as mentioned here: Zammad 6.0 Mobile client issues

It’s already mentioned on the release announcement New Major Release: Zammad 6.0! that you need to update the nginx config for /cable

location /cable {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
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;
proxy_read_timeout 86400;
proxy_pass http://zammad-railsserver;
}

however, I was inclined to just copy the existing configuration for my reverse proxy which sent the /cable traffic to the nginx in that is started with the docker-compose but the important part of the nginx configuration mentioned above is

proxy_pass http://zammad-railsserver;

which means that /cable has to go to the rails container and NOT the nginx that is started from the docker-compose.

To accomplish this, edit the docker-compose.override.yml and add to it:

services:
  zammad-railsserver:
    ports:
      - "10082:3000"

choose whatever port works for you.

on the reverse proxy then make the configuration look like this:

location /cable {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
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;
proxy_read_timeout 86400;
proxy_pass http://10.10.20.25:10082;
}

update the IP + Port from proxy_pass to match your environment.
Now all /cable requests are passed into the rails container and this fixes the issue.

1 Like

The first proxy proxying cable to the onboard nginx proxy shouldn’t be too much of an issue.
Your approach opens an port without encryption to the public internet unless you’re actively using a firewall that blocks everything that’s not allowed by default.

good point. Yes the machine where the container is running should be firewalled or even better not be exposed to the internet and just allow connections from the reverse proxy.
Wrote this with my setup in mind and forgot to think about other setups.

I wanted the simplest approach in terms of not editing any of the files that would be overwritten by the docker-compose setup that comes with the official repo.

1 Like

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