After updating, iPhone app will never use internal URL

In case anyone else runs into this, I had precisely the problem described in this post. TLDR; Go to your WIFI Connection’s setting in iOS15 and turn off “iCloud Private Relay” for your home SSID.

To recap the details: the Home Assistant iOS app worked fine on cellular but not on my home SSID. It seemed to be suddenly not working without any changes (several days after I upgraded to iOS 15 and was working before). The iOS export logs showed this:

2021-11-07 21:23:15.791 [Error] [main] [WebViewController.swift:333] webView(_:didFailProvisionalNavigation:withError:) > Failure during content load: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSErrorFailingURLKey=https://hass.mydomain.com:8123/lovelace-garage/0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <45807F48-97AF-4770-A795-EEDE0CF3699C>.<2>, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out., _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x282f85860>, networkTaskDescription=LocalDataTask <45807F48-97AF-4770-A795-EEDE0CF3699C>.<2>, _kCFStreamErrorDomainKey=4, NSErrorFailingURLStringKey=https://hass.mydomain.com:8123/lovelace-garage/0, NSUnderlyingError=0x28219d7a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}}

The super weird thing was I could open the same URL in this error in safari on the same device and it worked fine. I suppose the issue is that I am running a “split DNS” where my DNS server at home returns a local IP. I guess iCloud Private Relay tries to use that IP but from outside my network and it fails. Unclear to me why Safari works fine though and the Home Assistant iOS app doesn’t.

The reason I didn’t connect the dots here is that Apple Mail prompted to use private relay and I accepted in the moment and never fully appreciated that all traffic started going to private relay (all but safari??).