signalr 默认会调用websocket去连接集线器,centos下,用nginx默认设置不支持ws的
所以,必须更改配置,让nginx通过websocket
server { listen 80; server_name admin.mu-booking.com; location / { proxy_pass http://127.0.0.1:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
关键
proxy_set_header Connection upgrade,默认key-alive的,改成upgrade
原文地址:https://www.cnblogs.com/drek_blog/p/10823020.html
时间: 2024-10-06 00:45:31