Skip to content
Discussion options

You must be logged in to vote

Hi @outofsky! I'm Dosu and I’m helping the Trilium team.

你遇到的 WebSocket 报错,绝大多数是 nginx 反向代理配置缺少 WebSocket 必需的 header 或 proxy_pass 设置不对导致的。Trilium 官方和社区都明确要求 nginx 配置如下(假设 Trilium 监听 8080 端口,部署在根路径):

location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
client_max_body_size 0;
}
注意事项:

  • proxy_pass 必须用 http://,不要写成 https://,即使前端是 HTTPS/WSS。参考
  • 必须加 proxy_http_version 1.1 和 Upgrade/Connection 相…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@eliandoran
Comment options

Answer selected by eliandoran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
State: Triage Issues that need to be verified BE Issues related to server-side/back-end
2 participants
Converted from issue

This discussion was converted from issue #7754 on November 15, 2025 17:34.