diff --git a/balancer/Dockerfile b/balancer/Dockerfile index e973bad..74106e0 100644 --- a/balancer/Dockerfile +++ b/balancer/Dockerfile @@ -3,3 +3,4 @@ FROM nginx:1.13.7 EXPOSE 80 COPY nginx.conf /etc/nginx/nginx.conf +COPY htpasswd /etc/htpasswd diff --git a/balancer/htpasswd b/balancer/htpasswd new file mode 100644 index 0000000..a3e589d --- /dev/null +++ b/balancer/htpasswd @@ -0,0 +1 @@ +elogy:$apr1$F/.6ZKei$TPtCM40dHh/cfwfKLBLa40 diff --git a/balancer/nginx.conf b/balancer/nginx.conf index 5bd4358..dcfbf75 100644 --- a/balancer/nginx.conf +++ b/balancer/nginx.conf @@ -25,7 +25,6 @@ http { server { listen 80; server_name localhost; - location ^~ /api { proxy_pass http://backend:80; proxy_set_header HOST $host; @@ -34,6 +33,8 @@ http { location ^~ /admin { proxy_pass http://backend:80; proxy_set_header HOST $host; + auth_basic "Administrator's Area"; + auth_basic_user_file /etc/htpasswd; } location ^~ /attachments { @@ -51,4 +52,4 @@ http { root html; } } -} \ No newline at end of file +}