theme.park
theme.park copied to clipboard
Caddy v2 header replacement causes websockets to stop working.
Describe the bug Caddy v2 header replacement causes websockets to stop working. Is there a way that search pattern or replacement part can not wipeout the websocket headers?
Theme Install Method (Don't skip)
Application Info
- Version caddy 2.5.2
This doesn't allow websockets to work in caddy v2
....
@sonarr host sonarr.domain.tld
handle @sonarr {
authorize with default_policy
filter {
content_type text/html.*
search_pattern </head>
replacement "<link rel='stylesheet' type='text/css' href='https://theme-park.dev/css/base/sonarr/plex.css'></head>"
}
reverse_proxy http://srv-l-01.internal.domain:8989 {
header_up -Accept-Encoding
}
}
....
But this does allow websockets to work in caddy v2
....
@sonarr host sonarr.domain.tld
handle @sonarr {
authorize with default_policy
# filter {
# content_type text/html.*
# search_pattern </head>
# replacement "<link rel='stylesheet' type='text/css' href='https://theme-park.dev/css/base/sonarr/plex.css'></head>"
# }
reverse_proxy http://srv-l-01.internal.domain:8989 {
header_up -Accept-Encoding
}
}
....
Expected behavior websockets to work
Screenshots
Desktop (If applicable) (please complete the following information):
- OS: All
- Browser: All
@jef Any tips?
@GilbN I haven't ran into this yet. I can play around with it when I come from vacation.
This is a known issue with caddy2-filter, dont think you can really work around it, doesnt seem to be the case. Answered/explained by the plugin dev here sjtug/caddy2-filter#10, would be nice if we could find a solution to it though.
This is a known issue with caddy2-filter, dont think you can really work around it, doesnt seem to be the case. Answered/explained by the plugin dev here sjtug/caddy2-filter#10, would be nice if we could find a solution to it though.
Thanks for the update.
Closing this based on the info above.
@GilbN Not sure why you closed this when its not fixed. I know caddy2-filter isn't your project but your documention says to use this plugin but it breaks basic functionality of WS.
Is there another plugin? Is there another way to do this with caddy?
Regards, Lue.
@GilbN Not sure why you closed this when its not fixed. I know caddy2-filter isn't your project but your documention says to use this plugin but it breaks basic functionality of WS.
Is there another plugin? Is there another way to do this with caddy?
Regards, Lue.
Switch to nginx. Caddy doesn't support subfiltering with websockets. What do you want me to do about it.
@GilbN "Switch to nginx." Ok I will probably do that.
"What do you want me to do about it." Probably remove caddy from the docs as a support proxy for sonarr, radarr and anything that uses WS.
Made me believe it would work without issue...