Cannot connect remotely

Hi, I have installed HA and everything is ok. I also have installed duckdns and nginx. But when I try to log by remote xxxx.duckdns.org address, I get stuck with this: Unable to connect to Home Assistant. Retry

Please, any help will be appreciated :wink:

Albert

Have you checked the NGINX logs to see if the connection is making it to NGINX?

1 Like

Hi Tinkerer,

Thank you very much for your help!!! This is the last lines of log, it looks everything is ok, right?

[25/Apr/2022:18:40:41 +0200] 400 - - http localhost β€œ-” [Client 181.29.19.157] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:42:33 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:42:37 +0200] 200 - GET http 207.188.163.153 β€œ/” [Client 103.195.103.32] [Length 1154] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:42:41 +0200] 400 - - http localhost β€œ-” [Client 181.29.19.157] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:44:20 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:44:44 +0200] 400 - - http localhost β€œ-” [Client 181.29.19.157] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:46:21 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:48:22 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:49:28 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:50:40 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:51:18 +0200] 400 - - http localhost β€œ-” [Client 181.29.19.157] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:54:18 +0200] 400 - - http localhost β€œ-” [Client 181.29.19.157] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:54:41 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:55:19 +0200] 400 - - http localhost β€œ-” [Client 141.226.89.175] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:18:55:19 +0200] 400 - - http localhost β€œ-” [Client 141.226.89.175] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:00:12 +0200] 400 - - http localhost β€œ-” [Client 54.210.77.120] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:00:42 +0200] 400 - - http localhost β€œ-” [Client 186.57.254.111] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:07:27 +0200] 400 - - http localhost β€œ-” [Client 54.210.77.120] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:07:28 +0200] 400 - - http localhost β€œ-” [Client 54.210.77.120] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:08:44 +0200] 400 - - http localhost β€œ-” [Client 212.193.53.86] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:15:32 +0200] 404 - POST http 207.188.163.153 β€œ/boaform/admin/formLogin” [Client 179.43.167.122] [Length 118] [Gzip 1.36] β€œMozilla/5.0 (Windows NT 10.0; Win64; x64) Gecko/20100101 Firefox/71.0” β€œhttp://207.188.163.153:80/admin/login.asp”
[25/Apr/2022:19:15:32 +0200] 400 - - http localhost-nginx-proxy-manager β€œ-” [Client 179.43.167.122] [Length 0] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:19:25 +0200] 400 - - http localhost β€œ-” [Client 54.210.77.120] [Length 150] [Gzip -] β€œ-” β€œ-”
[25/Apr/2022:19:20:05 +0200] 400 - - http localhost β€œ-” [Client 77.81.98.70] [Length 150] [Gzip -] β€œ-” β€œ-”

maybe this can help to know the issue why is not working:
2022/04/25 16:36:10 [error] 628#628: *270 SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) while SSL handshaking to upstream, client: 207.188.163.xxx, server: xxx.duckdns.org, request: β€œGET / HTTP/2.0”, upstream: β€œhttps://192.168.1.xxx:8123/”, host: β€œxxx.duckdns.org”, referrer: β€œhttp://homeassistant.local:81/”

  1. You should be doing SSL in NGINX only, not HA
  2. The upstream shouldn’t be using https://
1 Like

ok, let me get this right:

In nginx configuration scheme, I put https? and, when you say upstream? where??

I can pay you if you help me connecting remotely and make it work! :wink:

That upstream.

It’s going to be easier to help you fix your config if you share it :wink:

1 Like

Hi, I’m sharing my configuration.yaml. But if I try to enter to https://homeassistant.local:8123 is says error, ERR_SSL_PROTOCOL_ERROR

homeassistant:
external_url: http://xxx.duckdns.org:8123
internal_url: http://homeassistant.local:8123

We need your NGINX configuration

1 Like




Images of text are horrible, you’re relying on people having the same vision as you. Please share text as text…

That said your problems are likely simple:

  1. First screenshot you haven’t enabled websockets support
  2. Second screenshot says https instead of http
  3. Eventually you can fix the external URL setting in HA to use https://
2 Likes

Hi Tinkerer, I followed your 3 points, reboot, and nothing, I get this:

Login attempt or request with invalid authentication from 207.188.162.128 (207.188.162.128). (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36)

Well, that sounds like you’ve at least got a connection?

1 Like

Yes Tinkerer, but how can I solve it?? Thank you very much

Did you open ports on your router?

1 Like

Yes, 80, 81, 443 and 8123

I personally don’t use NGINX, but I do use DuckDNS addon. Maybe you can try to disable the Nginx addon, and see if you’ll get that part working first. Nginx is not necessary for for your HA dashboard to be accessed via your Duckdns address.

The DuckDNS addon documentation says the following has to be set in the addon configuration.

lets_encrypt:
  accept_terms: true
  certfile: fullchain.pem
  keyfile: privkey.pem
token: sdfj-2131023-dslfjsd-12321
domains:
  - my-domain.duckdns.org
aliases: []
seconds: 300

Did you set Accept_terms to true?

Next to that, you have to add the following to the configuration.yaml:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

you can comment out the external_url and internal_url for this to test.

1 Like

Here is a tutorial:

This might help you out.

1 Like

Hi Johanf,

I follow it, stop nginx, but, still, I went to the door using duckdns, but β€œUnable to connect to Home Assistant.”.
It also looks my let’s encrypt stops alone although is marked start on boot. I’m stuck with this log:

Login attempt or request with invalid authentication from 207.188.162.xxx (207.188.162.xxx). (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36)

I also change port forwarding, 443 to 8123 instead of 443 to 443