HA on RPI only accessible through IPv6 access through reverse proxy with IPv4

Following problem: I have HA on a RPI which is only accessible through IPv6 as my home network only has IPv6. It uses TLS and a host name, everything works well. Now I also want to acces HA through IPv4 as many networks do not have IPv6.

Following solution: I followed this guide: Reverse proxy using NGINX and set up a domain name and TLS certificate on a remote server which has IPv4 and 6, and is re-reouting IPv4 traffic to my IPv6-only RPI. Except for the following: For the proxy_pass configuration I wanted to use my RPI domain name, but this is not possible. NGINX gets confused if a domain resolves only in AAAA and not in A. So I used my IPv6 but also with https.

I can access my HA login windows through my external server now. If I login i get the message “Unable to connect to Home Assistant.”. If I login directly through my home network I find a message saying: Login attempt or request with invalid authentication from (my IPV6) (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0)

How can I soleve this? What is the “invalid authentication”? Thanks!