Apache reverse proxy for Prometheus

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 TheTinchoTheTincho is useful — rate it up!

rating: 0+x
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License