mailinabox
mailinabox copied to clipboard
Add WebSocket support to hidden proxy feature in www/custom.yaml
Proxy support (using www/custom.yaml
) is a hidden feature in Mail-in-a-Box which I truly appreciate. However, many of the services I write nowadays use WebSockets, and the proxy support configuration lines added by Mail-in-a-Box do not support this. I've tested and confirmed that it is easy to add WebSocket proxy support using the following extra configuration parameters in the volatile file /etc/nginx/conf.d/local.conf
:
# added for WebSocket support; see https://www.nginx.com/blog/websocket-nginx/
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
So, I will find a way to extend the www/custom.yaml
support to add a parameter or option to indicate that a particular proxy directive should include support for WebSockets, and if so will include these extra configuration lines. I will be happy to submit a pull request with my changes, if others would find this functionality useful.
Please add websocket support!
Please add websocket support!
I submitted a pull request for this, and am running it live on my own fork.
Hopefully this feature lands in a future version, soon!