部署! - ShigemoriHakura/aclivechat GitHub Wiki

如何部署到Linux服务器上:

nginx转发:

upstream aclivechat {
    keepalive 8;
    # aclivechat地址
    server 127.0.0.1:12451;
}

location /
{
    proxy_pass http://aclivechat;

    proxy_connect_timeout 4s;
    proxy_read_timeout 60s;
    proxy_send_timeout 12s;
    # 代理websocket必须设置
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";

    # 由于这个块有proxy_set_header,这些不会自动继承
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~ .*\.(js|css|gif|ico|png)$ {
    proxy_pass http://aclivechat;
}

需要部署HTTPS证书才可以使用wss!!!

编译:

go build
./aclivechat