Hi, so my configuration is as follows: opnsense router forwards all port 80 and 443 traffic to an nginx VM, which reverse-proxies to some VMs or my hassio pi based on the inbound domain name.
All the preexisting VM webservers work fine (using HTTP), I’ve had this basic nginx/opnsense setup for years, but hassio is giving me serious problems. Just trying to use HTTP for hassio as well.
Logging in to the hassio web UI via the local IP and port continues to work fine, but logging in via the external domain has problems. The nginx reverse proxy gets an http 101 (connection upgrade) from hassio which causes the iframe to reset. So it seems like there’s some issue with the upgrade from http to websocket. What this amounts to is, the login goes smoothly, but then any page I land on will refresh every ~10s or so.
Here’s my current nginx config, it’s gone through a lot of iterations. Any ideas?
map $http_upgrade $connection_upgrade {
default Upgrade;
'' close;
}
upstream websocket {
server 192.168.73.67:8123;
}
server {
listen 80;
server_name myserver.com;
underscores_in_headers on;
proxy_read_timeout 1h;
proxy_buffering off;
location / {
include /etc/nginx/reverse-proxy.conf;
proxy_pass http://192.168.73.67:8123/;
proxy_http_version 1.1;
proxy_redirect https:// http://;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
location /api/websocket {
include /etc/nginx/reverse-proxy.conf;
proxy_pass http://192.168.73.67:8123/api/websocket;
proxy_http_version 1.1;
proxy_redirect https:// http://;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
}