WebSocket issues with Caddy since Chrome 138

1. The problem I’m having:

I’m using Caddy as a reverse proxy in front of an Odoo instance, and have been doing so for years with great results.

However, since about 10 days ago, WebSocket / real-time functionality has stopped working reliably. This affects Chrome-based browsers (starting with version 138 and still broken in 139+ beta/dev), while Firefox continues to work fine.

There are no visible client, server, or reverse proxy errors — but the real-time updates stop flowing silently.

The same issue does not occur if I switch the reverse proxy from Caddy to Nginx — which leads me to think the problem lies somewhere in how Caddy and recent versions of Chrome handle WebSockets.

To confirm it’s not the app itself, I tested older Odoo snapshots (several months old, previously working fine), and the issue persists only when served through Caddy + Chrome 138+.

I’ve tried several reverse_proxy configurations without success (timeouts, http transport, etc).

I’m trying to understand:

  • How I could debug this further?
  • If there are any relevant Caddy options I should try?

Any help would be appreciated.

2. Error messages and/or full log output:

There are, I think, no relevant error in logs (even in debug mode), and the issue does not generate any console error in the browser.
The WebSocket connection appears to establish but doesn’t receive any events.

3. Caddy version:

Tested on:

  • Latest v2.8.0
  • Latest v2.10.0
  • Current master (built locally with xcaddy)

4. How I installed and ran Caddy:

System environment:

Official docker image, custom docker image

My Caddy config:

odoo.example.com {
  reverse_proxy 127.0.0.1:8069
  reverse_proxy /websocket 127.0.0.1:8072
  encode zstd gzip
}

(Also tested with and without header_up directives — same issue, whereas it has always worked as showed withtout special configuration).

Thanks again for your time.

@Fabien Can you show me how to deploy odoo using docker? I tried the official docker compose (odoo 17.0, postgresql 15), but postgresql-15 will fail with postgresql ls: cannot access '/docker-entrypoint-initdb.d/': Operation not permitted. Using psql 14, however odoo container will fail with incompatible database.

Thanks for your time. I use my own images, based on community fork OCB (but I tested with official Odoo images too, v16 only).

That said, since the latest image stable updates (without any configuration changes, and without me understanding why if I look at the logs), I no longer have the problem on my production.

Now if you’d like to test it for yourself and see, here are the requested elements with the smallest files I can propose :

docker-compose.yml

services:
  postgres:
    image: postgres:14
    environment:
      TZ: Europe/Paris
      POSTGRES_USER: odoo
      POSTGRES_PASSWORD: password
      PGDATA: /opt/odoo/pgdata
    volumes:
      - pgodoo16:/opt/odoo/pgdata

  odoo:
    init: true
    image: odoo:16
    environment:
        TZ: Europe/Paris
        ADMIN_PASSWORD: dev
        HOST: postgres
        USER: odoo
        PASSWORD: password
    depends_on:
      - postgres
    volumes:
      - odoo16:/opt/odoo/data

  caddy:
    init: true
    image : caddy:2
    environment:
      TZ: Europe/Paris
      ODOO_SERVER_NAMES: odoo16
    ports:
      - 127.0.0.1:8026:443
    volumes:
      - ./caddy/:/etc/caddy/:ro

volumes:
  pgodoo16:
  odoo16:

And minimal Caddyfile

odoo16 {
  reverse_proxy odoo:8069
  reverse_proxy /websocket odoo:8072
  encode zstd gzip
  tls internal
}

tls internal is for local https testing, odoo16 is alias for 127.0.0.1.
You may need to bootstrap a first PostgreSQL database, logged as postgres user on the container : createdb -U odoo -O odoo -T odoo init

Thanks again, don’t waste much time on this. Have a nice week.

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