Zammad with docker met mobole lost connect

Infos:

  • Used Zammad version: 6.3.1
  • Used Zammad installation type: docker-compose
  • Operating system: ubuntu20.04
  • Browser + version:

Expected behavior:

  • Mobile noticed lost connection with server

Actual behavior:

Steps to reproduce the behavior:

  • I check for the nginx’s conf for zammad and zammad_ssl
    # 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 $scheme;
        proxy_read_timeout 86400;
        proxy_pass http://zammad-railsserver;
    }

it have this ; my http setting is https and set our own domain.
i use a new nginx conf for reverse proxy

my nginx’s conf for reverse proxy :

server {
    listen 80;
    server_name support.domain.com;
    
    # 将HTTP请求重定向到HTTPS
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name support.domain.com;
    
    ssl_certificate /etc/nginx/ssl/fullchain5.pem;  # 修改为你的SSL证书路径
    ssl_certificate_key /etc/nginx/ssl/privkey5.pem;  # 修改为你的SSL证书私钥路径

    # 强制使用较强的SSL协议和加密套件
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    location / {
        proxy_pass http://192.168.8.201:8080;  # 修改为你的后端服务地址
        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;
    }

    # 如果需要添加其他配置,请在此处添加
}

i see the post [Zammad 6.0 Mobile client issues - #42 by David_Martinez] ,but i don’t know how to further investigation

Hi @phoenix. Well, your nginx.conf is not correct I would say. Please compare it with zammad/contrib/nginx/zammad_ssl.conf at stable · zammad/zammad · GitHub

I should explain for it : I am not change the default nginx conf (zammad.conf and zammad_ssl.conf in container) ; my own nginx conf only reverse the port 8080 to expose my own domain to Internet

the zammad_ssl.conf in container is :

#
# this is an example nginx config for using SSL with zammad
# this can be adjusted to be used with self-signed, trusted ca and letsencrypt certs
# this example uses letsencrypt certs. replace all occurrences of example.com with your domain
# If using LetsEncrypt create letsencrypt certificate by: certbot certonly --webroot -w /var/www/html -d www.example.com
# create dhparam.pem by: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
# download LetsEncrypt x3 certificate by: wget -q https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem -P /etc/nginx/ssl
# you can test your ssl configuration @ https://www.ssllabs.com/ssltest/analyze.html
#

upstream zammad-railsserver {
  server 127.0.0.1:3000;
}

upstream zammad-websocket {
  server 127.0.0.1:6042;
}

server {
  listen 80;
  listen [::]:80;

  server_name example.com;

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

  access_log /var/log/nginx/zammad.access.log;
  error_log /var/log/nginx/zammad.error.log;

  location /.well-known/ {
    root /var/www/html;
  }

  return 301 https://$server_name$request_uri;

}


server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;

  server_name example.com;

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

  ssl_certificate /etc/nginx/ssl/example.com-fullchain.pem;
  ssl_certificate_key /etc/nginx/ssl/example.com-privkey.pem;

  ssl_protocols TLSv1.2;

  ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

  ssl_dhparam /etc/nginx/ssl/dhparam.pem;

  ssl_prefer_server_ciphers on;

  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 180m;

  ssl_stapling on;
  ssl_stapling_verify on;

  ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;

  resolver 8.8.8.8 8.8.4.4;

  add_header Strict-Transport-Security "max-age=31536000" always;

  location = /robots.txt  {
    access_log off; log_not_found off;
  }

  location = /favicon.ico {
    access_log off; log_not_found off;
  }

  root /opt/zammad/public;

  access_log /var/log/nginx/zammad.access.log;
  error_log  /var/log/nginx/zammad.error.log;

  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 $scheme;
    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 $scheme;
    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	$scheme;

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

    proxy_read_timeout 180;
    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;
  }
}

I try to understand the doc, but it is also confuesd me about the proxy ; I am new for deploying zammad

I change my own nginx.conf ;
example,

proxy_pass http://192.168.8.98:8080

when change to localhost

proxy_pass http://localhost:8080

ZAMMAD can get the true IP .

But the error : Zammad with docker met mobole lost connect
also exist

I change the nginx for reverse proxy ,like this :

    location / {
        proxy_pass http://localhost:8080;  # 修改为你的后端服务地址
        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;

	 # WebSocket 相关的头信息
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
	proxy_read_timeout 86400;

    }

and I see the log of nginx and test ,seems never meet the error about lost connect with server again

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