iOS App not connect with NGINX Proxy

I have been using the app successfully (thanks) but I have just setup and NGINX reverse proxy with SSL enabled via a a Let’s Encrypt certifcate.

All seems to be working well if I connect to ha via the web interface, and the iOS app connects and allows me to control/trigger things, but it doesn’t seem to update.

For instance, I can turn my lights on, but they remain showing as off in the app, so I cannot turn them off again.

When I look at the settings page it lists the following statuses:

Name: Home
Version: 0.31.1
Connected: true
iOS Component Loaded: true
Device Tracker Component Loaded: true
iOS Notify Platform Loaded:false

I have no notifications enabled so I guess this is correct.

My NGINX config is the same as reconvened in the wiki with the exception of using a server name as I have other servers behind the proxy.

Any ideas/suggestions on what could be causing this?

One other thing, it seems I am now unable to change the URL or password for my server once configured in the app, it’s greyed out and not editable. Also when the app fails to connect or authorize to the server it brings up the configuration page, but there’s no way to leave it once you have changed the settings other than force quitting the app?

Thanks

Gareth

1 Like

Actually I am seeing connected show as false most of the time, occasionally true.

When the connection is showing as false, as it is right now, I can reach the endpoint in the browser on my iPhone with no issues.

I have my DNS setup with my external DNS resolving to my wan ip, port forwarded and router via NGINX. Internally I have dnsmasq running on my router that forwards the request directly to NGINX. Both have a 1 minute TTL so that they should resolve correctly going between my Lan/Wan.

Is the app doing any kind of DNS caching, or storing the IP resolved by the domain name?

I’m also seeing location tracking no longer working unless I physically open the app since I enabled the iOS Component, prior to enabling it was working very reliably.

Thanks

Gareth

I connect through Nginx without issues. The app isn’t doing any DNS caching, but Apple most likely is. If you want you can reach out to me on Gitter for more one-on-one debugging.

The settings behavior mentioned is correct currently. The reason for this is because I am working on correctly resetting entire app state if you change the URL/password since the app is going to only support a single Home Assistant instance (at least for now). If you need to change the URL either turn on Airplane mode so that your phone can’t access Home Assistant, at which point it will let you change the URL or reinstall the app.

Operator error, I had forgotten to set the following in my NGINX config to allow websockets to work.

proxy_buffering off;

Fixed now!

Cheers

Gareth

I’m also seeing an inconsistency with the iOS app showing the correct state for devices (in my case, a lock). I often need to force quit the app and restart it for it to reflect the correct state (HASS on the web always shows the correct state).

I updated my Nginx config to turn proxy_buffering off, as suggested by gazzer82. It seems like the iOS app switches to a “connected” state quicker now, and my first test afterwards did happen to work, but upon further testing when locking/unlocking the iOS app often does not reflect the changes. I’ve tried waiting 30+ seconds after a state change to give the app time to update, but to no avail.

for those of you running the ios app through nginx. are you using HA authentication?

I am still having issues with this. I keep getting Authentication error on the iOS app.
What’s are the setting should I change on my Nginx app.
I am running Nginx and Hassio on unraid.

I can connect find with the web interface but not on the app