zammad / zammad-docker-compose

Zammad Docker images for docker-compose
https://hub.docker.com/r/zammad/zammad-docker-compose/
GNU Affero General Public License v3.0
273 stars 223 forks source link

Unable to connect to websocket with caddy as ingress #400

Closed PaulGoldschmidt closed 8 months ago

PaulGoldschmidt commented 8 months ago

Hey,

I have now tried to debug the following issue for two full days but not have been able to find a solution: I installed Zammad without a problem on my server, the incoming traffic is routed with caddy to the docker zammad nginx container, which should handle the rest™ of the traffic mangement. The website loads without a problem, but no connection to the websocket server can be established. The websocket container itself does not log anything after startup, the last message is "INFO -- : Using the Redis back end for Zammad's web socket session store.. The zammad nginx container logs for each connection attempt upstream prematurely closed connection while reading response header from upstream, client: 172.27.0.1, server: _, request: "GET /ws HTTP/1.1", upstream: "http://172.27.0.7:6042/ws" followed by GET /ws HTTP/1.1" 502 150 "-". Any idea on what could be causing this issue or how to debug this? I definetly hit the boundary of what I know with this issue, which is quite frustrating because everything else works without a problem. I would also be down to write some documentation if my setup works.

Any help is highly appreciated, tysm!

All the best, Paul

Infos

Expected behavior

Actual behavior

error

Steps to reproduce the behavior

Current Caddy reverse proxy setup

fqdn {
    encode gzip
    header Strict-Transport-Security "max-age=31536000;"

    reverse_proxy http://127.0.0.1:4353 {
        # Caddy automatically upgrades connections to HTTP/2 where possible.
        # Set header directives equivalent to the Nginx configuration.
        header_up Host {host}
        header_up X-Real-IP {remote}
        header_up X-Forwarded-For {remote}
        header_up X-Forwarded-Port {server_port}
        header_up X-Forwarded-Proto {scheme}
        header_up Connection {>Connection}
        header_up Upgrade {>Upgrade}
    }

        @ws {
                header Connection *Upgrade*
                header Upgrade websocket
        }
   # WebSocket configuration
    reverse_proxy /ws http://127.0.0.1:4353 {
           header_up Upgrade {http.upgrade}
    header_up Connection "Upgrade"
    header_up CLIENT_IP {remote_host}
    header_up X-Forwarded-For {http.request.remote}
    }
   header @staticFiles Cache-Control "max-age=31536000, public"
}
MrGeneration commented 8 months ago

Sorry, but this seems to be a technical question. Please note that this repository is the wrong place for technical questions. Instead, please refer the Zammad community over at: https://community.zammad.org .

In case this turns out the be a bug and no technical question, we'll transfer the relevant information to this repo!

If you require commercial grade support and are no hosted or support contract customer, you can check out our support contracts here: https://zammad.com/pricing#selfhosted If you're paying customer already, please consult your Zammad support for assistance! :-)