# Connection lost with external connections

**URL:** <https://discourse.nodered.org/t/connection-lost-with-external-connections/44289>\
**Category:** General\
**Created:** [16 April 2021 15:54 UTC](https://discourse.nodered.org/t/connection-lost-with-external-connections/44289 "2021-04-16T15:54:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terralytics](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Terralytics](https://discourse.nodered.org/u/Terralytics)\
**Post date:** [16 April 2021 15:54 UTC](https://discourse.nodered.org/t/connection-lost-with-external-connections/44289/1 "2021-04-16T15:54:00Z")

</div>

I have NodeRed running with Docker (running on Windows, using Linux containers). When connecting to NodeRed with localhost:1880 everything works fine. NodeRed is connected to the www with Apache as webserver (running on windows). When trying to access NodeRed externally I can login and I can see my flows, but as soon as I'm displaying the page I get the message 'connection lost, trying to reconnect in x seconds'.

Any ideas what may cause this? I cannot find anything strange in the logfiles from NodeRed or Apache.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 April 2021 16:47 UTC](https://discourse.nodered.org/t/connection-lost-with-external-connections/44289/2 "2021-04-16T16:47:16Z")

</div>

Most likely, you haven't proxied the websocket connections. There are examples in the forum and elsewhere on how to do that. You have to proxy both HTTPS and WSS.

---

<div class="post-metadata">

**Author:** ![Terralytics](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@Terralytics](https://discourse.nodered.org/u/Terralytics)\
**Post date:** [16 April 2021 17:22 UTC](https://discourse.nodered.org/t/connection-lost-with-external-connections/44289/3 "2021-04-16T17:22:48Z")

</div>

Great, thanks for the quick reply. I googled a lot before asking the question and couldn't find anything. But apparently I was looking in the wrong direction. I added the next rows to my existing vhost in Apache to fix it:

> RewriteEngine On  
> RewriteCond %{HTTP:Upgrade} =websocket [NC]  
> RewriteRule /kpn(.\*) ws://localhost:1880$1 [P,L]  
> ProxyPreserveHost On  
> ProxyRequests Off  
> ProxyVia Off

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 April 2021 17:23 UTC](https://discourse.nodered.org/t/connection-lost-with-external-connections/44289/4 "2021-04-30T17:23:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
