asp.net core signalr Error: Failed to start the transport 'WebSockets': null


關於signalr 線上https 環境報錯Error: Failed to start the transport 'WebSockets': null 的解決方案:

1、問題

    本地http與https 連接無異常,但是前端通過nginx轉發訪問,會報異常

2、原因

    nginx 默認不支持websockets 

3、解決方案:

在對應訪問的域名下添加如下配置:

    proxy_pass http://backend;

    proxy_http_version 1.1;

    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection "upgrade";


 

f you have you app in Windows Server just enable thw "WebSocket Protocol".

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM