Caddy 2: KiwiBNC websocket reverse_proxy

I am having trouble routing KiwiBNC IRC bouncer webchat into a path on my site.

With the config seen below, I can access the webchat via the server IP and port 3001, plain http. I had to use this when I was still using Caddy v1 as well as I was unable to figure out a proper config after some changes in KiwiBNC routing code.

If I try to access it via I see in my dev tools console I get XHR 404 for

Any ideas?

Caddy v2 config:, {
    encode gzip
    root * /var/www/mysite
    route /kiwibnc/* {
        uri strip_prefix /kiwibnc

The location of the 404’d file on disk is

The source for KiwiBNC’s webchat routing:

KiwiBNC’s config.ini:

# Each listener accepts plain TCP connections, Websocket connections, and HTTP requests if enabled
bind = [

# Websocket connections will only be allowed from these whitelisted websites
websocket_origins = [

# A static HTTP server. Handy for serving a web client such as Kiwi IRC
# If the webchat extension is enabled too, Kiwi IRC will automatically be downloaded
# and configured into the public_dir.
enabled = true
base_path = "/"
public_dir = "/var/www/kiwidata/kiwiirc"

# Extra configuration for the Kiwi web interface. The webchat extension must be loaded
# See
# In exotic server setups or reverse proxies the correct BNC server may not be correctly detected.
# This server option should point to a listener address as configured above.
"startupOptions.websocket" = "wss://"

It sounds to me like you’re running into the subpath problem, but I’m not certain.

I generally recommend to use a subdomain instead for proxying to other apps.

But I do see that your config.ini has base_path = "/". I think you should be setting that to base_path = "/kiwibnc" maybe?

Thanks, I will look into using a subdomain. Changing the base_path option did not help.

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