mailinabox icon indicating copy to clipboard operation
mailinabox copied to clipboard

Add WebSocket support to hidden proxy feature in www/custom.yaml

Open eslindsey opened this issue 3 years ago • 1 comments

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.

eslindsey avatar Apr 04 '21 22:04 eslindsey

Please add websocket support!

DreamTexX avatar Jan 18 '22 11:01 DreamTexX

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!

JJJ avatar Apr 23 '24 04:04 JJJ