I frequently get “Unable to connect to Home Assistant - Retry” messages when attempting to open HA (Hassio) both from Chrome on Windows and Chrome on Android. Clicking/tapping Retry successfully connects after one or two tries.
Is this expected behavior? Any suggestions how to eliminate these messages and always connect successfully? That would greatly improve partner approval factor.
Disabling http/2 in your proxy should be enough to remove the message. I’m on mobile right now so I can’t post the config. Ping me if you can’t find the flag and need an example.
Thanks for the tip. Are you using Caddy by any chance? I tried disabling http/2 in my Caddyfile, but I can’t work out what the correct format should be. I’ve tried various locations/formats/bracketing of http2 off using the (sub)directives alpn and tls according to the vague instructions here https://github.com/mholt/caddy/pull/1389 and here https://caddyserver.com/docs/tls. Everything I’ve tried results in an unknown directive or unknown subdirective error.
Here is the working (apart from the original issue in this thread) beginning of my Caddyfile.
OK, I’ve disabled http/2 with Caddy thanks to a tip on Github. So far, @Florian, disabling http2 appears to have done the trick. I haven’t yet had an “unable to connect” message with several connections from both my laptop and phone. Fingers crossed. I’ll watch it and report back after a couple of days if the error is gone for good. Thanks.
For anyone else looking, the correct format in my Caddyfile follows. The key is enabling only http/1.1. Doing that disables http/2.
Very much appreciated, was wondering why this was happening.
@srk23 I would recommend using nginx-proxy-manager if you’re not very experienced with nginx. It has a nice web based GUI which also includes this option. There’s also a hassio add-on for it.
I also had that problem and I was using NGINX Proxy Manager (NPM) and a duckdns.org domain. I found that I had to enable the Websockets Support in NPM. I didn’t had any issue with HTTP/2 as I have it enabled and its working fine!
For the host, besides websockets support, I have configured Block Exploits. In the SSL settings, I have Force SSL, HTTP/2 and HSTS enabled. All was done using the GUI and I didn’t had to add or edit any configuration.
# Block Exploits
include conf.d/include/block-exploits.conf;
# HSTS (ngx_http_headers_module is required) (31536000 seconds = 1 year)
add_header Strict-Transport-Security "max-age=31536000; preload" always;
location / {
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (31536000 seconds = 1 year)
add_header Strict-Transport-Security "max-age=31536000; preload" always;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
To anyone how dealt with this problem : don’t forget to clean your cookies after any change.
If you don’t want to clean every single cookie, for example in chrome, click the padlock to the left of the adress bar, then “cookies”, then select and erase.
Maybe you found the solution and you don’t know it