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:
Despite the error message not being clear, the fix is quite simple:
- Open Control Panel and then Application Portal
- Select the Reverse Proxy tab
- Select the rule you want to fix and click in Edit
- At the Custom Header tab, create a new entry for Websocket
Now, the custom header should have the following two entries:
Done! The docker terminal app should be working now.