Thanks for sharing.
This is a bit old. New code better use library(http/http_dyn_workers)
or load all server basics using library(http/http_server)
.
On public ports some browsers insist on https (wss). If you use nginx as proxy you need something like below. This rule is from SWISH. The first two lines (resolver and proxy_pass) are there to find the lxc container in which SWISH runs and probably needs adapting.
location /chat {
resolver 10.0.3.1;
proxy_pass http://$container$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 86400;
}