HomeAssistant配置SSL之后,登录失败出现
Unable to connect to Home Assistant.,效果如下所示
image.png

原因
通过websocket协议连不上你的homeassistant。打开你浏览器的调试模式出现WebSocket connection to 'wss://xxxxx/api/websocket' failed: Error during WebSocket handshake: 'Upgrade' header is missing

解决方法
nginx如下配置即可

location / {
        proxy_pass http://127.0.0.1:8000/;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        #主要是下面两句
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }