As far as I understood it back when I was testing Realtime Editing behind a reverse proxy, home and protocol URL configuration tells XWiki / the application server on which protocol to “send out” stuff. (Link: Realtime WYSIWYG behind reverse proxy - #9 by TomTheWise)
When not set, you still can access XWiki on https / port 443 when the reverse proxy is configured even though XWiki home and URL are http / port 80 by default. But when XWiki initiates a download or similar its not an “answer” but rather a “send” to the client and then it is sending it over its default protocol / port.
That is why these two parameters in the config are important. As the XWiki is behind a reverse proxy, it is probably not possible / not easy to replace that two configurations with some kind of automatism.
It could be, that my understanding of this is not 100% precise, so take it with a grain of salt. But its something in that general direction.