Chat not working; HTTP 502 Bad Gateway, behind Reverse Proxy

  • Used Zammad version: 3.4.x
  • Used Zammad installation source: Docker-Compose
  • Operating system: Synology Rackstation, Kernel Version 4.4.59+
  • Browser + version: Edge Beta 84.0.522.28

Expected behavior:

  • activate chat and successfull embed it on my website

Actual behavior:

  • chat got activated. On my Website it returns an HTTP 502 Error
  • direct calling https://…/ws fails with NGINX HTTP 502 Error-Page

I installed Zammad via official Docker-Compose Port 80 is mapped to 8081. On my Rackstation i setup an https reverse prox for the subdomain to the internal ip of the ip:8081.

Following HTTP-Headers are setup in the reverse proxy.

Zammad works fine. But if i want to set up chat, I run in HTTP 502 error.

If i call i get following error:


If i call the http pendand directly from our internal network, I’ll get the same error.

I suggest the websockets will only work with real https. But i pull my hairs and can’t get https working in the zammad container. If i try to redirect https port 443 to 8443 zammad is not reachable (empty response), port 80 works. In the docker env I suggest Logs go to stdout and are collected from synology rackstation.

There i can find the following error:

[error] 16#16: *27 upstream prematurely closed connection while reading response header from upstream, client:, server: _, request: “GET /ws HTTP/1.1”, upstream: “”, host: "zammad.

In the websocket container i can’t find any hints in the log.

This is my first entry here and i’m new to zammad. I hope my information are a good basis to help me solving this problem.

Thank you.

I found the solution by my self. The Error 502 Bad Gateway in the URL https://fqdn/ws which is handled by the docker-compose nginx reverse proxy is not the problem.

The problem was my own reverse proxy.

I deleted the HTTP Headers and set them up again and now it works. If i remove them from the config, it fails again. Setting them again, and the chat works on our page.

This is the correct setup:



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