Failed to upgrade websocket connection: websocket: request origin not allowed by Upgrader.CheckOrigin

Summary
As many other in this forum, Im facing a issue with the websocket connection.

{"timestamp":"2023-11-26 12:40:28.516 Z","level":"debug","msg":"Failed to upgrade websocket connection.","caller":"web/context.go:111","path":"/api/v4/websocket","request_id":"bxwqri3wein5xq6wuh7ufmxpkh","ip_addr":"127.0.0.1","user_id":"dxzqbhra3bbuubf53cy35r8j3o","method":"GET","err_where":"connect","http_code":400,"error":"connect: Failed to upgrade websocket connection., websocket: request origin not allowed by Upgrader.CheckOrigin"}

Steps to reproduce
Install Mattermost with the omnibus method.

sudo MMO_HTTPS=false apt install mattermost-omnibus

In other server install Caddy as a reverse proxy.

chat.troco.io {
        encode gzip

        reverse_proxy 192.168.10.108:8065

        log {
                output file /var/log/caddy/troco.io/mattermostCaddy.log {
                        roll_size 500mb
                }
        }
}

Go to chat.troco.io

Open web inspector, see websocket connection fail with 403
Go to mattermost logs and see the error
Failed to upgrade websocket connection., websocket: request origin not allowed by Upgrader.CheckOrigin

Expected behavior
Websocket should work even if its proxied.
Or at least should be possible to change that Upgrader.CheckOrigin setting

Observed behavior
Websocket fails to connect.

Integrations configuration settings — Mattermost documentation might help