I updated n8n to 1.5 im getting connection lost

Alright so for anyone that needs it I have just spent a bit of time learning about Apache2 as a reverse proxy.

To get n8n up and running with Websockets in 1.0 below is an example config file that works when used with n8n in a container. This example is for HTTP so if you were using HTTPS you would need to make those changes.

<VirtualHost *:80>
        ServerName n8n.yourdomain.tld

        RewriteEngine On
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /(.*)           ws://172.17.0.1:5678/$1 [P,L]
        RewriteCond %{HTTP:Upgrade} !=websocket [NC]
        RewriteRule /(.*)           http://172.17.0.1:5678/$1 [P,L]
        ProxyPassReverse /          http://n8n.yourdomain.tld
</VirtualHost>

This will need proxy, proxy_http, proxy_wstunnel and rewrite to work but as of right now on a clean Digital Ocean droplet using n8n 1.1.1 this works.