apiVersion: v1
kind: ConfigMap
metadata:
  name: node-exporter-nginx-conf
  namespace: default
  labels:
    app.kubernetes.io/name: exporter
    app.kubernetes.io/component: node-exporter
data:
  nginx.conf: |
    daemon off;
    worker_processes  auto;
    pid /tmp/nginx.pid;
    worker_rlimit_nofile 608192;
      
    events {
      worker_connections  10000;  ## Default: 1024
      multi_accept on; ## https://nginx.org/en/docs/ngx_core_module.html#multi_accept
      use epoll; ## https://nginx.org/en/docs/events.html#epoll
    }
    
    http {
      proxy_cache_path /tmp/nginx/client_temp levels=1:2 keys_zone=all:1m max_size=1g;
      client_body_temp_path /tmp/nginx 1 2;
      proxy_temp_path /tmp/nginx 1 2;
      fastcgi_temp_path /tmp/nginx 1 2;
      uwsgi_temp_path /tmp/nginx 1 2;
      scgi_temp_path /tmp/nginx 1 2;
      server {
        listen 9102;
        server_name _;
        access_log off;
        error_log off;
        tcp_nopush on;
        tcp_nodelay on;
        server_tokens off;
        keepalive_requests 1000;

        location / {
          proxy_pass http://127.0.0.1:9101;
          proxy_cache all;
          proxy_cache_valid any 1s;
          proxy_cache_use_stale updating;
        }
      }
    }
