Skip to content

Instantly share code, notes, and snippets.

@laurentbel
Last active December 31, 2023 15:33
Show Gist options
  • Save laurentbel/391e57e601f7d1c81d2d4e74879383d7 to your computer and use it in GitHub Desktop.
Save laurentbel/391e57e601f7d1c81d2d4e74879383d7 to your computer and use it in GitHub Desktop.
Loki Nginx basic authentication

Loki secured with basic authentication using Nginx

Basic setup to protect loki with basic authentication using Nginx

services:
loki:
image: grafana/loki:2.2.0
command: -config.file=/etc/loki/local-config.yaml
networks:
- loki
nginx:
image: laurentbel/nginx-basic-auth
ports:
- "80:80"
depends_on:
- loki
environment:
- FORWARD_HOST=loki
- FORWARD_PORT=3100
- BASIC_USERNAME=john.doe
- BASIC_PASSWORD=myp@ssword!
networks:
- loki
networks:
loki:
@erickellerek1
Copy link

did you activate the auth_enable: true in the loki/local-config.yaml?

@laurentbel
Copy link
Author

I left auth_enable = true which is the default value in Loki’s config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment