Enable basic Auth for Prometheus

Related-Prod: PROD-33847

Change-Id: I540d8bca31f4e977d0d34dab95c5c2ff31ef236a
(cherry picked from commit 18e1acee1122f5d49c8116df36771abea72aa913)
diff --git a/nginx/server/proxy/monitoring/prometheus_alertmanager.yml b/nginx/server/proxy/monitoring/prometheus_alertmanager.yml
index ed7c675..e3c1811 100644
--- a/nginx/server/proxy/monitoring/prometheus_alertmanager.yml
+++ b/nginx/server/proxy/monitoring/prometheus_alertmanager.yml
@@ -1,12 +1,26 @@
 parameters:
+  _param:
+    nginx_proxy_prometheus_alertmanager_user: alertmanager
+    # default password is set for backward compatiblity
+    nginx_proxy_prometheus_alertmanager_password: ${_param:keepalived_prometheus_vip_password}
+    nginx_proxy_prometheus_alertmanager_htpasswd_file: .htpasswd_prometheus_alertmanager
   nginx:
     server:
       enabled: true
+      user:
+        prometheus_alertmanager:
+          enabled: true
+          name: ${_param:nginx_proxy_prometheus_alertmanager_user}
+          password: ${_param:nginx_proxy_prometheus_alertmanager_password}
+          htpasswd: ${_param:nginx_proxy_prometheus_alertmanager_htpasswd_file}
       site:
         nginx_proxy_prometheus_alertmanager:
           enabled: true
           type: nginx_proxy
           name: prometheus_alertmanager
+          auth:
+            engine: basic
+            htpasswd: ${_param:nginx_proxy_prometheus_alertmanager_htpasswd_file}
           proxy:
             host: ${_param:prometheus_control_address}
             port: 15011
diff --git a/nginx/server/proxy/monitoring/prometheus_server.yml b/nginx/server/proxy/monitoring/prometheus_server.yml
index d9eb261..d429be1 100644
--- a/nginx/server/proxy/monitoring/prometheus_server.yml
+++ b/nginx/server/proxy/monitoring/prometheus_server.yml
@@ -1,12 +1,26 @@
 parameters:
+  _param:
+    nginx_proxy_prometheus_server_user: prometheus
+    # default password is set for backward compatiblity
+    nginx_proxy_prometheus_server_password: ${_param:keepalived_prometheus_vip_password}
+    nginx_proxy_prometheus_server_htpasswd_file: .htpasswd_prometheus_server
   nginx:
     server:
       enabled: true
+      user:
+        prometheus_server:
+          enabled: true
+          name: ${_param:nginx_proxy_prometheus_server_user}
+          password: ${_param:nginx_proxy_prometheus_server_password}
+          htpasswd: ${_param:nginx_proxy_prometheus_server_htpasswd_file}
       site:
         nginx_proxy_prometheus_server:
           enabled: true
           type: nginx_proxy
           name: prometheus_server
+          auth:
+            engine: basic
+            htpasswd: ${_param:nginx_proxy_prometheus_server_htpasswd_file}
           proxy:
             host: ${_param:prometheus_control_address}
             port: 15010