How to fix Synology DSM Socket Close issue

A great feature of some models of the Synology NAS is to be able to run Docker containers directly from the DiskStation Manager (DSM - web-based operating system for every Synology NAS). You can search and download Docker images and configure and run new containers. Synology even gives you a terminal to access the containers.

What is a NAS?

The issue that motivated this blog post happens when the NAS is behind a reverse proxy. The DSM Reverse Proxy doesn’t support web socket by default, breaking the terminal app on Docker with the following exception:

Socket closed.

Despite the error message not being clear, the fix is quite simple:

  1. Open Control Panel and then Application Portal
  2. Select the Reverse Proxy tab
  3. Select the rule you want to fix and click in Edit
  4. At the Custom Header tab, create a new entry for Websocket

Now, the custom header should have the following two entries:

Reverse proxy rules at Synology DSM

Done! The docker terminal app should be working now.

o/

M ↓   Markdown
?
Anonymous
0 points
3 years ago

This makes absolutely no sense, as there are exactly NO rules in the reverse proxy tab.

M
Marco
0 points
3 years ago

Hey! I only got the "socket closed" issue when using the NAS behind a reverse proxy, you might have missed that part in the text. I was not aware of this happening also when not using reverse proxy, but how are you accessing your Synology? I can try to replicate it.

Э
Эдуард Укухе
0 points
3 years ago

Thank you my friend ))

M
Marco
0 points
3 years ago

You're very welcome!

D
Dennis Wieringa
0 points
3 years ago

This doesnt work on my DSM 7.0 I need to fill in following options to save the headers:

Reverse Proxy Name:, Souce Port:, Destination Port:

M
Marco
0 points
3 years ago

Hi Dennis, this configuration is only needed if you're already using Synology behind a reverse proxy. If that's not your case, it's most likely you have a different problem.

?
Anonymous
0 points
2 years ago

Thank you!! this has been bugging me for a while now

?
Anonymous
0 points
24 months ago

Was driving me nuts... Thank you.

?
Anonymous
0 points
3 years ago

Thanks for your article :)