enable basic auth

This commit is contained in:
knoflook 2022-03-18 15:11:31 +01:00
parent ab6950cc2a
commit 8c2718dc89
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
3 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
export PROMTAIL_YML_VERSION=v2
export NODE_EXPORTER_ENTRYPOINT_VERSION=v1
export NGINX_CONFIG_VERSION=v9
export HTPASSWD_CONFIG_VERSION=v1
export NGINX_CONFIG_VERSION=v11
export HTPASSWD_CONFIG_VERSION=v2

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: nginx:1.20.0
image: nginx:1.20.0-alpine
networks:
- proxy
- internal

View File

@ -1,4 +1,4 @@
user www-data;
#user www-data;
events {
worker_connections 768;
@ -13,14 +13,20 @@ http {
resolver 127.0.0.11;
location ~ ^/node_exporter(.*)$ {
auth_basic "admin";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
proxy_pass http://{{ env "STACK_NAME" }}_node_exporter:9100$1;
}
location ~ ^/cadvisor(.*)$ {
auth_basic "admin";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
proxy_pass http://{{ env "STACK_NAME" }}_cadvisor:8080$1;
}
location ~ ^/promtail(.*)$ {
auth_basic "admin";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
proxy_pass http://{{ env "STACK_NAME" }}_promtail:9080$1;
}
}