so, for various reasons, i'm forced to host a website on an apache2 server (server A). this is not the server that is publicly accessible in my network, so another server (server B) is relaying requests to server A through a reverse proxy that i have written myself using express.js
server A exposes its website on port 8080, and server B is routing traffic from port 80 and 443 to it. SSL is completely handled by the proxy.
now, it seems like whenever apache uses a redirect to, for example, correct something in the url (turning https://example.com/something into https://example.com/something/) it appends :8080 after the domain. so it turns https://example.com/something into https://example.com:8080/something/
how can i prevent this from happening?