在 prometheus_startup_centos7
采用 nginx_reverse_proxy
,使用的是 sub-path
模式,也就是说我的访问域名 onesre.cloud-atlas.io
的子路径 http://onesre.cloud-atlas.io/prometheus/
反向代理到运行 prometheus_startup
部署的服务器:
- 配置
/etc/nginx/conf.d/onesre-core.conf
设置反向代理:
prometheus_behind_reverse_proxy/sub-path_nginx.conf
- 此时访问页面会报错的,需要修订
/etc/systemd/system/prometheus.service
添加--web.external-url
运行参数:
prometheus_behind_reverse_proxy/prometheus.service
重启 prometheus.service
之后,就能正常通过 http://onesre.cloud-atlas.io/prometheus/
反向代理访问新部署的 prometheus_startup_centos7