user  nginx;
worker_processes  5;  ## Default: 1
events {
  worker_connections   1000;
}
http {
  resolver 127.0.0.11;
  server {
    listen             3100;
    location = / {
      return 200 'OK';
      auth_basic off;
    }
    location = /api/prom/push {
      proxy_pass       http://write:3100\$$request_uri;
    }
    location = /api/prom/tail {
      proxy_pass       http://read:3100\$$request_uri;
      proxy_set_header Upgrade \$$http_upgrade;
      proxy_set_header Connection "upgrade";
    }
    location ~ /api/prom/.* {
      proxy_pass       http://read:3100\$$request_uri;
    }
    location = /loki/api/v1/push {
      proxy_pass       http://write:3100\$$request_uri;
    }
    location = /loki/api/v1/tail {
      proxy_pass       http://read:3100\$$request_uri;
      proxy_set_header Upgrade \$$http_upgrade;
      proxy_set_header Connection "upgrade";
    }
    location ~ /loki/api/.* {
      proxy_pass       http://read:3100\$$request_uri;
    }
  }
}