Caddy error connecting to a wbsocket

1. The problem I’m having:

Trying to connect caddy to a websocket. The backend is activemq, and it is working with apache and nginx.
For some reason caddy returns 404.
The backend is working

2. Error messages and/or full log output:

Not working from caddy, working from apache (I had to edit to image because I am only allowed one image):

3. Caddy version:

2.7.6

4. How I installed and ran Caddy:

just caddy run the caddy.exe file

a. System environment:

b. Command:

c. Service/unit/compose file:

d. My complete Caddy config:

http://127.0.0.1 {

    reverse_proxy /mq* 127.0.0.1:43020 {
        header_up Connection {>Connection}
        header_up Upgrade {>Upgrade}
        header_up Sec-WebSocket-Key {>Sec-WebSocket-Key}
        header_up Sec-WebSocket-Version {>Sec-WebSocket-Version}
        header_up Sec-WebSocket-Protocol "v10.stomp"
	}
    reverse_proxy /* 127.0.0.1:8080 {
        header_up Host {host}

    }

	log {
        output file "c:\Programs\caddy_2.7.6_windows_amd64\logs\caddy_access.log"
		level ERROR
		format json
    }	

}

5. Links to relevant resources:

Remove all this. You’re breaking the websocket connection by trying to set these things.

Caddy handles websocket headers appropriately, automatically.

You don’t need this either, Caddy passes through the Host header as-is by default.

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