标签:socket应用 sof redis 均衡 back proxy location str plane
signalR是相当不错的websocket应用,最近要做集群和负载均衡
主要用到了redis进行集群,signalR的backplane集成redis。
细节,订阅redis之后注意database号
再使用nginx进行负载均衡。
细节,设置websocket(我是用websocket的传输)的配置参数,Upgrade 头的处理
http { map $http_upgrade $connection_upgrade { default upgrade; ‘‘ close; } upstream websocket { server 192.168.100.10:8010; } server { listen 8020; location / { proxy_pass http://websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } }
参考文章如下:
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis
https://www.nginx.com/blog/websocket-nginx/
http://www.cnblogs.com/liqiao/p/4396194.html
标签:socket应用 sof redis 均衡 back proxy location str plane
原文地址:http://www.cnblogs.com/RainbowInTheSky/p/6766883.html