Get Grafana to stop changing port (Reverse Proxy server)

When I access my grafana instance through my reverse proxy server, it seems to work fine at first. However, when I navigate to another organization, the port changes to what is in defaults.ini, which will not work when I deploy.

Here’s my situation:

I am using defaults.ini [server] section to serve grafana to my Apache server on the same machine i.e. grafana-server.exe starts on localhost:3000, which Apache passes to port 8080.


Some Apache config:

Here one sees that Apache passes localhost:3000 to port 8080. I want to only access grafana via port 8080.

It works fine when I first connect on port 8080, but if I navigate to another Org via the dropdown, it tries to go through 3000 and I get a weird error:

Upon further inspection the error contains this message:

Manually typing “8080” in place of “3000” works. My hypothesis is that grafana just throws the default.ini configs (where 3000 comes from) directly into the url request in the browser.

Does anyone know how to stop this behavior? Maybe it’s only happening because they are running on the same machine, and it would be fine in production (currently working on testing this…)