docs: guide for running Prometheus behind a reverse proxy - #3060
Open
locker95 wants to merge 1 commit into
Open
Conversation
Common Host/X-Forwarded-* headers, external-url notes, and a short warning about lifecycle/admin paths when proxying. Signed-off-by: Dean Chen <862469039@qq.com>
jan--f
requested changes
Aug 26, 2026
jan--f
left a comment
Contributor
There was a problem hiding this comment.
Thanks, nice addition! Just a few comments.
Comment on lines
+18
to
+20
| If you terminate TLS or add authentication at a reverse proxy, see | ||
| [Running Prometheus behind a reverse proxy](/docs/guides/reverse-proxy/). | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| If you terminate TLS or add authentication at a reverse proxy, see | |
| [Running Prometheus behind a reverse proxy](/docs/guides/reverse-proxy/). |
Not sure this is right place to cross link this. Maybe better places are /docs/guides/tls-encryption.md' and /docs/guides/basic-auth.md`?
Comment on lines
+42
to
+43
| | `Host` | Original host as seen by clients (or the public hostname you intend Prometheus to see) | | ||
| | `X-Forwarded-Proto` | `https` when TLS is terminated at the proxy so redirects stay on HTTPS | |
Contributor
There was a problem hiding this comment.
Iirc Prometheus uses relative redirects internally. While its good practice to suggest bot headers, the purpose is not quite accurate, as Promteheus doesn't use the information.
Maybe just
Suggested change
| | `Host` | Original host as seen by clients (or the public hostname you intend Prometheus to see) | | |
| | `X-Forwarded-Proto` | `https` when TLS is terminated at the proxy so redirects stay on HTTPS | | |
| | `Host` | Original host the client used, not used by Prometheus but good practice | | |
| | `X-Forwarded-Proto` | `https` when TLS is terminated at the proxy, not used by Prometheus but good practice| |
| If the proxy serves Prometheus under a public hostname or URL prefix, set | ||
| [`--web.external-url`](https://prometheus.io/docs/prometheus/latest/command-line/prometheus/) | ||
| to that public base URL (including path prefix if any). This is used for | ||
| generated links, redirects, and the expression browser. |
Contributor
There was a problem hiding this comment.
Suggested change
| generated links, redirects, and the expression browser. | |
| generated links. |
I'm not sure about the last two statements. If you're sure about the let me know, otherwise let's err on the side of caution and drop them?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short guide on proxying Prometheus:
--web.external-url, Host / X-Forwarded-* headers, nginx and Caddy snippets, and a note about lifecycle/admin paths. Linked from the security model page.Fixes #2950