This is a simple configuration for Apache to act as a reverse proxy for Prometheus, allowing for SSL and/or user authentication. It should be on its own VirtualServer.
ProxyPreserveHost On ProxyPass / http://localhost:9090/ ProxyPassReverse / http://localhost:9090/
If you want to publish Prometheus only in a certain prefix, you can also do that:
ProxyPreserveHost On ProxyPass /prometheus http://localhost:9090/prometheus ProxyPassReverse /prometheus http://localhost:9090/prometheus
In both cases, the -web.external-url flag should be set to match the visible URL.
Rate this tip
If you think this tip by TheTincho is useful — rate it up!