diff --git a/roles/aurweb/templates/nginx.d.conf.j2 b/roles/aurweb/templates/nginx.d.conf.j2 index 58715f12efa74b26f2ceceeb09f9a153673525d3..7ad03b8cd65c21578d31dd21a57ee7eb0e92947c 100644 --- a/roles/aurweb/templates/nginx.d.conf.j2 +++ b/roles/aurweb/templates/nginx.d.conf.j2 @@ -129,9 +129,11 @@ server { } location = /rpc/metrics { +{% if aurweb_environment_type == 'prod' %} if ($http_authorization != "Bearer {{ vault_goaurrpc_metrics_token }}") { return 403; } +{% endif %} proxy_pass http://127.0.0.1:10666/metrics; proxy_set_header X-Forwarded-For $remote_addr; @@ -151,9 +153,11 @@ server { } location = /metrics { +{% if aurweb_environment_type == 'prod' %} if ($http_authorization != "Bearer {{ vault_aurweb_metrics_token }}") { return 403; } +{% endif %} {{ self.asgi_proxy() }} }