Websockets for Synology DSM
It’s happened to me several times now that an application I run on my DS 1817+ has problems with websockets. This is because I use the reverse proxy built into DSM, which does not support websockets by default. For this reason, here’s a little tutorial on how to enable Websockets for Synology DSM reverse proxy.
Enable Websockets in DSM Reverse Proxy
Actually, it is extremely easy to enable Websockets for Synology DSM reverse proxy:
- Open Control Panel > Application Portal
- Change to the Reverse Proxy tab
- Select the proxy rule for which you want to enable Websockets and click on Edit
- Change to the Custom Headers tab
- Add two entries in the list:
- Name: “Upgrade”, Value: “$http_upgrade”
- Name: “Connection”, Value: “$connection_upgrade”

Repeat these steps for every rule where you want to enable Websockets.
In my local setup, I need this for GitLab Mattermost (running within a docker container) and DSM Virtual Machine Manager Console.
18 COMMENTS
Running into authentication issues with Home Assistant I’ve found your write-up and wanted to say thanks for this excellent explanation!
It appears this is now available by default: just click the down arrow on the Create button in that Custom Headers tab, and select “WebSocket”.
Oh, I didn’t know that! Thank you very much!
[…] If you’re using the DSM reverse proxy, you can still use GitLab’s capabilities for getting LetsEncrypt certificates or configure HTTPS offloading (the reverse proxy terminates the HTTPS connection and forwards requests internally using HTTP) and use DSM’s capabilities for getting LetsEncrypt certificates. When configuring the hosts, please be sure to enable Websocket Support. […]
THANK YOU!! This helped me get Hasura working with subscriptions on my synology.
So grateful for your post, helped me out running rocket chat behind synology reverse proxy. On mobile phone app gave me websocket related error and with your guide fixed the problem!
Your instructions were so clear and worked perfectly.
You helped me a lot.
Thank you very much Matthias 😉
Yes ! it’s save me a lot of time !
Thanks
For WebSockets also add the header “Origin” and make it “”
Is it possible to use a wss connection?
What exactly do you mean with use? Using this configuration example, you’re able to provide a wss connection.
Was looking for this. Great and easy solution. Thanks!
Thanks, Matthias,
I was struggling with “code server” and reverse proxy until I found your post!
Glad it helped 🙂
Just wanted to say this is absolutely necessary to get reverse proxy to work with The Spaghetti Detective if you are using the reverse proxy of DSM. It took me forever to figure out websockets was the culprit, and after doing this, it works PERFECTLY. I’m currently running DSM 7 on a 920+.
Yaay! With your tutorial I managed to move my diabetes management system from a commercial cloud environment (Heroku) to my Synology. I had fiddled around whole day before I found your blog. I’m extremely happy, thank you so much for sharing your knowledge!
Thanks so much for this post! Didn’t realize how easy enabling Web Sockets was, and makes a lot of my self hosted apps work way better.
Thanks very much. I have a private Synology home server. I reinstalled Onlyoffice – in Docker. I had problems with the recent update of Onlyoffice 7.3 – the connection between Nexcloud Onlyoffice didn’t work. According to GitHub, the bug was found. (Library for exchanging data with the server changed from sockjs to socket.io) Unfortunately, Synology does not offer direct access to Apache2 with a .conf file. In addition to the schema extension of the Onlyoffice dB, I applied the hint from you. And yes – everything works again – as it should. Thank you Paulo