/!\ Connection lost with http reverse proxy Apache


I’ve set an instance of n8n behind a reverse proxy Apache, with n8n basic authentication
I can connect, browse, open WFs despite this orange message à top right, but I can’t execute them :
## Problem running workflow
There was a problem running the workflow:
No active connection to server. It is maybe down.
Thank you

That is a sign that your reverse proxy is not configured correctly to work with Server-sent events.

Here are some other topics about it:

I used 3 load-balanced reverse proxies, could it be the root cause despite n8n uses rest APIS ?
I’ve got no issue if I use a single reverse proxy with the same configuration for an other n8n instance

If it works with one then I guess that is the problem. Sadly have no experience with Apache so can not be much of a help there.

How do you detect this lost connection Jan ? I suppose you don’t trigger a socket to the caller of course.
Do you read 0 characters from the caller or something like that ? I need to know to inverstigate a little more proxy side - thanks Jan

There is no special code for that. All it does is that it tries to connect and if it can not or if the connection gets closed it displays “connection lost”.
It is not using WebSocket it is using Server-sent Events (EventSource) for that. For them to work properly through a reverse proxy it has to get configured in a special way. Examples for that can be found in the topics I linked above.

So I will dig the config for SSE indeed …
Just a little thing seen with tcpdump, at the first GET after basic authentication, I can see this strange answer, is it linked ?

        .%l.....GET / HTTP/1.1
        Host: zxxx:8002
        Cache-Control: max-age=0
        Authorization: Basic dmxhZGltaXI6bHV0aW9uaWFsZQ==
        Upgrade-Insecure-Requests: 1
        User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
        Accept-Encoding: gzip, deflate
        Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
        X-IWS-Via: 1.1 1EAA5587 (IWSS)
        Via: 1.1 eaccxxxxxxxxxx.com
        X-Forwarded-For: 160.x.x.x
        X-Forwarded-Host: eaccxxxxxx.com
        X-Forwarded-Server: eaccxxxxxxx.com
        Connection: close
        .....%l.HTTP/1.1 200 OK
            X-Powered-By: Express
            Access-Control-Allow-Origin: http://localhost:8080
            Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE^M
            Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, sessionid
            Content-Type: text/html; charset=utf-8
            Content-Length: 953
            ETag: W/"3b9-a3vjNK0vX6Frxj+x8MPAE8xsgPA"
            Vary: Accept-Encoding
            Date: Thu, 13 Aug 2020 16:39:02 GMT
            Connection: close
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=//favicon.ico><script>window.BASE_PATH = "/";</script><title>n8n.io - Workflow Automation</title><link href=/css/app.7543c5fb.css rel=preload as=style><link href=/css/chunk-vendors.67f38bab.css rel=preload as=style><link href=/js/app.c8fcc753.js rel=preload as=script><link href=/js/chunk-vendors.4d0ed7d4.js rel=preload as=script><link href=/css/chunk-vendors.67f38bab.css rel=stylesheet><link href=/css/app.7543c5fb.css rel=stylesheet><link href=/fonts.css rel=stylesheet></head><body><noscript><strong>We're sorry but the n8n Editor-UI doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.4d0ed7d4.js></script><script src=/js/app.c8fcc753.js></script></body></html>

But just a Connection lost in GUI

The cause is our entreprise cisco VPN which seems to not support SSE

Uh, that is bad. Sorry but if there is no way to make SSE work then I can sadly not think of a way right now to use the n8n-Editor as it relies on it. But still very surprised. Extra chose that technology as it is very simple and is supported by almost everything.