在 n8n 遇到 Connection lost 可能的解決方法 - Frank Blog

# 在 n8n 遇到 Connection lost 可能的解決方法

1 min read
Table of Contents

緣起Link to heading

這幾天在研究 n8n 該如何使用,原本只有架設在 local ,但發現我們社團的主機有好幾臺在空著就架在了那邊

怎麽架的?Link to heading

我用官方文件的 docker run 來跑, Port 跑在預設的 5678 沒有設Docker Proxy

問題來了Link to heading

問題來了當我架好之後出現了

n8n Connection lost 錯誤 Error
錯誤截圖

原因為何?Link to heading

按下 F12 看了 Console 之後發現有個 WebSocket 無法連線,推測是因為 WebSocket 沒有被 Proxy 到

解決方法Link to heading

這裡我附上 Cloudflare Proxy 和 Nginx Proxy 上的解決方法,怕讀者也遇到這種問題

CloudflareLink to heading

在 網路 -> 打開 WebSocket 選項(HTTP/2也要開)

NginxLink to heading

在代理的地方加上這兩行

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
My avatar

We’re all human…Link to heading

We are all human and sometimes we make mistakes. If you have found one in this article then I am really sorry. Please reach out to me using the link in the footer and I will get it rectified ASAP.


More Posts