【发布时间】:2018-09-23 11:02:49
【问题描述】:
环境
操作系统:红帽 7
ReverseProxy:Apache(仅限)
部署方式:Docker
================================================ ==========================
问题:
是否可以在 Apache 反向代理中进行更改,以便我可以通过
访问 prometheus 控制台
"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 状态:
docker run -d --name 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/
访问网址“http://myserverurl/”->“http://myserverurl/graph”
结果成功:
================================================== ======================
还尝试了以下组合 - 不起作用:
ProxyPass /promethus/ http://0.0.0.0:9090/
ProxyPassReverse /promethus/ http://0.0.0.0:9090/
【问题讨论】:
标签: linux apache docker reverse-proxy prometheus