Skip to main content

🔐 Setup HTTPS with Self-Signed Certificate for Loki behind NGINX Reverse Proxy

📁 Step 1: Create Certificate Directory

📝 Step 2: Create loki-cert.conf Configuration File

🔑 Step 3: Generate SSL Certificate and Key

🌐 Step 4: NGINX Configuration for Loki HTTPS Proxy

Create or update your NGINX site config:

http and https both

🔐 Step 5: Create Basic Auth User

🌍 Step 6: Test the Endpoint (with --insecure for self-signed cert)

🏢 Step 7: Add Certificate to System Trust Store It will remove the error of TLS verification failed

Promtail Configuration ot use certificate :

  • use this if above update-ca-certificates does not work or you want to use certificate in promtail config file
  • After adding the above configuration in promtail config file, restart promtail service to apply changes.

🔄 Step 8: Restart Promtail to Apply Changes


✅ Now, Loki is served securely over HTTPS with self-signed certs and access control via NGINX.