*BRAND NEW ZAMMAD INSTALL via Docker/Portainer* - Mobile Issues - The connection to the server was lost

Infos:

  • Used Zammad version: 6.4.0
  • Used Zammad installation type: (source, package, docker-compose, …): Portainer Deployment (Docker)
  • Operating system: Base OS is Ubuntu 24.04.1 LTS
  • Browser + version: Multiple, but for instance, Chrome 131.0.6778.73 on iOS

Expected behavior:

Want to be able to respond to tickets via Mobile.

Actual behavior:

On mobile, ‘The connection to the server was lost’ message in the top right corner. Can’t do things like respond to tickets, etc.

I really have done no special configurations to the portainer deployment itself. I set the following variables on the nginx container:

NGINX_SERVER_NAME (gave it the proper FQDN [zammad.(mydomainisactuallyhere).com])
NGINX_SERVER_SCHEME (http) - I’ve experimented with both http and https, no difference there. I think http is proper in my deployment, as I have SSL termination happening upstream.

And, that’s it. I’ve done my searching/research, I’ve seen a lot of the articles talking about making sure the /cable location in the nginx conf is properly coded – but in a lot of those cases, those are people upgrading from a pre-6.0 version… This is a brand new 6.4.0 deployment and so that /cable location section in the server block looks perfectly fine. Not sure where else to begin looking.

Here is the running ‘default’ nginx conf within ‘sites-enabled’

$ cat default
#
# this is an example nginx config for Zammad
# Please visit https://docs.zammad.org for further input on how to configure
# your nginx to work with Zammad
#
# This is a NON SSL configuration, DO NOT use in production!
#

upstream zammad-railsserver {
  server zammad-railsserver:3000;
}

upstream zammad-websocket {
  server zammad-websocket:6042;
}

server {
  listen 8080;
  listen [::]:8080;

  # replace 'localhost' with your fqdn if you want to use zammad from remote
  server_name zammad.[mydomainisactuallyhere].com;

  # security - prevent information disclosure about server version
  server_tokens off;

  root /opt/zammad/public;

  access_log /dev/stdout;
  error_log  /dev/stdout;

  client_max_body_size 50M;

  location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico|apple-touch-icon.png) {
    expires max;
  }

  # legacy web socket server
  location /ws {
    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 http;
    proxy_read_timeout 86400;
    proxy_pass http://zammad-websocket;
  }

  # action 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 http;
    proxy_read_timeout 86400;
    proxy_pass http://zammad-railsserver;
  }

  location / {
    proxy_set_header Host $http_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 http;

    # Change this line in an SSO setup
    proxy_set_header X-Forwarded-User "";

    proxy_read_timeout 300;
    proxy_pass http://zammad-railsserver;

    gzip on;
    gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
    gzip_proxied any;
  }
}

Steps to reproduce the behavior:

Simply just load the webpage.

This happens to my zammad instance as well. Funnily enough, it seems to work fine if you can get the mobile browser to talk to it in HTTP instead. Of course, one wouldn’t want this in a production environment.

That’s interesting, Avery! Good to know – however, I don’t think that’ll work in my case, as I am not comfortable with that.

I don’t have HTTPS configured on Zammad and/or the correpsonding NGINX container.

I have two different ways of getting to Zammad. Externally, I am using a Cloudflare tunnel, and Cloudflare is handling the SSL termination. Internally, I am using HAProxy, and HAProxy is doing the SSL termination. In either case, this seems to either be a bug or a misconfiguration, so looking for guidance on corrective action.

You’re using two proxy servers. The first in the line (HAProxy) does not correctly forward websocket connections which is why you have these issues.

Same issue occurs when I remove HAProxy out of the equation. When I set my local DNS to be the Real IP address of the Docker container, and just hit it via http, same issue occurs:

FYI, did another test – I hit zammad via IP and not DNS, and I do not see the error message. Is there some env variable I need to set to tell websocket to respect DNS name?

Your FQDN and HTTP-Scheme have to fit all the way during the communication in between Zammad and your browser.

https://admin-docs.zammad.org/en/latest/settings/system/base.html

Access via Mobile (Requesting Desktop Site):

Access via Mobile (Normal Mobile Site):

Ok, so let’s recap, and keep in mind there is no reverse proxy in front of the Zammad ‘stack’ in this example.

In Zammad > System > Base:
FQDN is set properly (zammad.[mydomain].com)
HTTP type (set to http)

In Portainer > Containers > zammad-zammad-nginx-1 > Env
NGINX_SERVER_NAME set properly (zammad.[mydomain].com)
NGINX_SERVER_SCHEME set properly (http)

This is also reflected when I ‘cat’ the “default” nginx conf file

In my local DNS, I have zammad.[mydomain].com set to the IP address of the docker server (192.168.x.x) – and, when I do a ping or nslookup, it shows the proper IP address.

Now, we try to access http://zammad.[mydomain].com:8080

-From Desktop
No problems at all

-From Mobile
No problem when I ‘Request Desktop Site’
Problem occurs when loading the normal ‘Mobile Site’

Here are screenshots for evidence:


image
image

Access via Desktop Browser:

Site says I am limited to 4 attachments per post – so, in the adjacent post, I’ll attach the result on Mobile.

hello everyone, i have just installed zammad on my proxmox instance, via my nginx proxy manager i have https access via browser as well as on my mobile browser - but i also have the problem in the mobile view as described here. is there no solution?

Is there any hope for me? Anyone? Bueller?