diff --git a/roles/aurweb/templates/nginx.d.conf.j2 b/roles/aurweb/templates/nginx.d.conf.j2 index 58715f12efa74b26f2ceceeb09f9a153673525d3..8fdbc21dee74e3f088a6da881bf6b6a6e99f3caf 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() }} }