Skip to content

Instantly share code, notes, and snippets.

@taufiqpsumarna
Created August 13, 2024 05:12
Show Gist options
  • Save taufiqpsumarna/92893645532c3b11474c0b64afad416f to your computer and use it in GitHub Desktop.
Save taufiqpsumarna/92893645532c3b11474c0b64afad416f to your computer and use it in GitHub Desktop.
nginx reverse proxy for loki HTTP Basic Auth
server {
listen 80;
server_name <YOUR_DOMAIN_NAME>;
#Basic Auth
auth_basic "loki auth";
auth_basic_user_file /etc/nginx/.htpasswd_loki;
location / {
proxy_read_timeout 1800s;
proxy_connect_timeout 1600s;
proxy_pass http://localhost:3100;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
proxy_redirect off;
}
location /ready {
proxy_pass http://localhost:3100;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
proxy_redirect off;
auth_basic "off";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment