diff --git a/roles/matrix-prometheus-node-exporter/tasks/init.yml b/roles/matrix-prometheus-node-exporter/tasks/init.yml index 064699117..a6188def3 100644 --- a/roles/matrix-prometheus-node-exporter/tasks/init.yml +++ b/roles/matrix-prometheus-node-exporter/tasks/init.yml @@ -24,7 +24,7 @@ set $backend "matrix-prometheus-node-exporter:9100"; proxy_pass http://$backend/metrics; {% elif matrix_prometheus_postgres_exporter_container_http_host_bind_port != '' %} - proxy_pass http://{{ matrix_prometheus_postgres_exporter_container_http_host_bind_port }}/metrics; + proxy_pass http://{{ matrix_prometheus_node_exporter_matrix_nginx_proxy_not_enabled_proxy_pass_host }}/metrics; {% else %} return 404 "matrix-nginx-proxy is disabled and no host port was bound to the container, so metrics are unavailable"; {% endif %} diff --git a/roles/matrix-prometheus-postgres-exporter/tasks/init.yml b/roles/matrix-prometheus-postgres-exporter/tasks/init.yml index 0de0c0054..862a04cf4 100644 --- a/roles/matrix-prometheus-postgres-exporter/tasks/init.yml +++ b/roles/matrix-prometheus-postgres-exporter/tasks/init.yml @@ -24,7 +24,7 @@ set $backend "matrix-prometheus-postgres-exporter:9187"; proxy_pass http://$backend/metrics; {% elif matrix_prometheus_node_exporter_container_http_host_bind_port != '' %} - proxy_pass http://{{ matrix_prometheus_node_exporter_container_http_host_bind_port }}/metrics; + proxy_pass http://{{ matrix_prometheus_postgres_exporter_matrix_nginx_proxy_not_enabled_proxy_pass_host }}/metrics; {% else %} return 404 "matrix-nginx-proxy is disabled and no host port was bound to the container, so metrics are unavailable"; {% endif %}