nginx之websocket配置
location /websocket { proxy_pass http://ip:8088; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_set_header Upgrade websocket; proxy_set_header Connection Upgrade; }
报错信息:
websocket.ts:40 WebSocket connection to 'wss://t-yc-traffic-police.aegis-info.com/api/websocket?access_token=eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImU5NTA3ZGYwLTliMWQtNDdiZi1hYWMzLTM4OGUyYjkyMDQzMiJ9.ldsVQyao118QeUzGZtAc3GBKzKiOPXSZizKxcRwS7dIXXJXDNsnXrayxeARwztf19cbwG9KGADn5aQ6kmkxjyQ' failed: Error during WebSocket handshake: Unexpected response code: 400
修改nginx配置,新增长链接,配置正常####