Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow alertmanager to be run behind a reverse proxy #212

Closed
grobie opened this issue Jan 5, 2016 · 10 comments
Closed

Allow alertmanager to be run behind a reverse proxy #212

grobie opened this issue Jan 5, 2016 · 10 comments

Comments

@grobie
Copy link
Member

grobie commented Jan 5, 2016

The -web.external-url flag is no longer respected when loading assets. It's no longer possible to run alertmanager behind a reverse proxy.

@camerondavison
Copy link
Contributor

FYI I just did https://github.com/novilabs/alertmanager/commit/50937b09100abcc1d28f933baa38e2b22aa0ef01 to be able to use a prefix path of /alerts and run it behind my reverse proxy. It seems to be working well. I do not know a way to pass it through as configuration to the html and js files though. If anybody wants to know what files would need to be touched.

@hryamzik
Copy link

-web.external-url does seem to be broken (again?). @grobie, any comments on this?

@a86c6f7964 did you take a look on the pull request mentioned here? It seems to be a better solution.

@grobie
Copy link
Member Author

grobie commented Mar 11, 2016

It never got fixed so far unfortunately. Pull requests very welcome, I think all core contributors are very overworked right now.

@juliusv
Copy link
Member

juliusv commented Mar 29, 2016

Just looking at it, I got it almost working, except for one thing: the index.html is a static HTML page (not a Go template), so we can't inject the path prefix into it to fix up the JS and CSS asset links. Should we serve the web pages (at least index.html) through the Go template engine, like we do in Prometheus?

@fabxc
Copy link
Contributor

fabxc commented Mar 30, 2016

Without a closer look – that doesn't seem like something that should depend on passing through a template engine.
If it comes with complexity I cannot think of right now, sure – it doesn't have a relevant overhead.

@juliusv
Copy link
Member

juliusv commented Mar 30, 2016

@fabxc True. The alternative is to make all the paths between the assets relative. Trying that out now, it seems to work. It would mean that one has to be careful to not introduce any absolute paths anywhere, ever. But requiring a path prefix everywhere in the HTML+JS would have the same problem. Should I go for relative paths then?

@fabxc
Copy link
Contributor

fabxc commented Mar 30, 2016

Sure, it's not that many files and won't change frequently.

@mrwacky42
Copy link

+1 to relative paths.

@juliusv
Copy link
Member

juliusv commented Mar 30, 2016

juliusv added a commit that referenced this issue Mar 31, 2016
fabxc added a commit that referenced this issue Aug 5, 2016
This addresses the misleading error messages reported in #212
Explanation: #282 (comment)

Fixes #282
@sdwerwed
Copy link

sdwerwed commented Dec 2, 2020

I made it work like this (--web.external-url not -web.external-url)
/usr/local/bin/alertmanager --config.file /etc/alertmanager/alertmanager.yml --web.external-url=http://example.com:9093/alertmanager then add to nginx location /alertmanager {proxy_pass http:localhost:9093/alertmanager/;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants