Point four is the one people miss, and it is on the proxy rather than the application, so nobody looks there.
Several proxies default to sending the backend's address as the Host header rather than the one the browser used. The application then sees an internal name, fails the allowed-hosts check or builds the wrong origin, and no amount of adding your public hostname to the application's settings helps because your public hostname never arrives.
It is one line of proxy configuration in every proxy, but it is a different line in each of them. Check yours specifically rather than trusting that it does the obvious thing.
Same family of problem: proxies that strip or rewrite the forwarded protocol header, and chains of two proxies where only the outer one sets it correctly.