开源地址:https://github.com/Privoce/vocechat-server-rust
Docker安装
docker run -d --restart=always -p 3009:3000 --name vocechat-server Privoce/vocechat-server:latest
访问:http://localhost:3009/
Nginx反代
server{ server_name vocechat.yourdomain.com; location / { proxy_pass http://127.0.0.1:3009; # 此处端口号取决于前面设置的 VoceChat 运行端口号 proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_max_temp_file_size 0; # 关掉硬盘缓存,增加写速度 # SSE 相关配置 proxy_http_version 1.1; proxy_set_header Connection ''; } }
使用宝塔面板需注释或删掉以下代码
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; error_log /dev/null; access_log /dev/null; } location ~ .*\.(js|css)?$ { expires 12h; error_log /dev/null; access_log /dev/null; }