Nginx proxy blocks devices using IPv6?

I’ve set up Home Assistant (0.89.2) to be accessed through Nginx with a self-signed certificate, following this guide:


Nginx (version 1.15.9) is installed with Homebrew on the same computer running HASS.

It works perfectly, but not from iOS devices, and I suspect it has to do with IPv6. Login is denied with the error “Could not connect to Home Assistant”, and in the notifications “Login attempt … with invalid authentication from” followed by an IPv6 address.

The Nginx log: “(61: Connection refused) while connecting to upstream […] upstream: http://[::1]:8123/auth/login_flow/”

Any suggestions on what is missing in my setup?

From the Home Assistant cnfiguration:

http:
  base_url: https://example.com
  use_x_forwarded_for: true
  trusted_proxies: 127.0.0.1

Nginx configuration for the https listener, the configuration extends the default Homebrew one.
I’ve excluded the SSL parameters as it is exactly as the guide.

server {
    listen [::]:443 ssl http2 default_server ipv6only=off;
    server_name example.com;
    proxy_buffering off;
    location / {
        proxy_pass http://localhost:8123;
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

Solved. Seems iOS and some other devices don’t like sites with self-signed certtificates.