Harden embed live refresh with reconnect backoff and poll fallback.
Document Nginx SSE proxy settings for long-lived live streams. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -177,6 +177,24 @@ bash /opt/crypto_okx/deploy/manage.sh # 选 2
|
||||
- **页面打不开**:`pm2 status` / `pm2 logs crypto_okx --lines 50`
|
||||
- **OKX 失败**:先确认 SOCKS `ss -lntp | grep 1080`,再 `curl --proxy socks5h://...`
|
||||
- **脚本 `pipefail` 报错**(Windows 编辑过):`sed -i 's/\r$//' deploy/*.sh deploy/lib/*.sh`
|
||||
- **几分钟后资金/行情不自动刷新**:embed 壳靠 SSE(`/api/instance/live/stream`).若前面有 Nginx,需关闭缓冲并拉长超时,例如:
|
||||
|
||||
```nginx
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:5004;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_buffering off;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
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_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
```
|
||||
|
||||
改完后 `nginx -t && systemctl reload nginx`,浏览器强刷.前端另有断开重连与轮询兜底.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user