环境
操作系统: Redhat 7
ReverseProxy: Apache (仅限)
部署通过:码头
========================================================================
发行:
是否可以在Apache反向代理中进行更改,以便我可以通过
"http://myserverurl/prometheus“-> "http://myserverurl/prometheus/graph”
而不是当前失败的
"http://myserverurl/prometheus“-> "http://myserverurl/graph”(失败)
反向代理之后,URL被重定向,/promethus消失。
在Grafana设置中,我可以添加如下选项
(#docker run -d -p 3000:3000 -name=grafana -e "GF_SERVER_ROOT_URL=http://0.0.0.0/grafana“grafana/grafana)
它允许我访问Grafana控制台。
"http://myserverurl/grafana“-> "http://myserverurl/grafana/login”(成功)
========================================================================
码头状态:
docker run -d --名为prometheus -p 9090:9090 prom/prometheus

测试了proxypass的配置:(不起作用)
ProxyPass /prometheus http://0.0.0.0:9090/prometheus
ProxyPassReverse /prometheus http://0.0.0.0:9090/prometheus
行动:
试图访问"http://myserverurl/prometheus“
结果失败:
404页未找到
========================================================================
,但如果我按以下方式更改配置,它就能工作了:
ProxyPass / http://0.0.0.0:9090/
ProxyPassReverse / http://0.0.0.0:9090/
访问url "http://myserverurl/“-> "http://myserverurl/graph”
结果成功:

========================================================================
还尝试了以下组合-不起作用:
ProxyPass /promethus/ http://0.0.0.0:9090/
ProxyPassReverse /promethus/ http://0.0.0.0:9090/
发布于 2019-02-05 15:13:32
为了让prometheus本身侦听/prometheus而不是/您需要添加一个运行时参数:
--web.route-prefix="prometheus"
--web.external-url="http://myserverurl/prometheus"
(至少是双星普罗米修斯-2.7)
Prometheus调用:
prometheus --web.listen-address="127.0.0.1:9090" --web.route-prefix="prometheus" --web.external-url="http://myserverurl/prometheus"还添加了系统Apache rev代理:
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /prometheus http://127.0.0.1:9090/prometheus
ProxyPassReverse /prometheus http://127.0.0.1:9090/prometheushttps://stackoverflow.com/questions/49811012
复制相似问题