github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/ops/terraform/remote_files/health_checker/nginx.conf (about)

     1  worker_processes  2;
     2  
     3  events {
     4      worker_connections   2000;
     5  
     6  }
     7  
     8  http {
     9      default_type  text/plain;
    10  
    11      client_header_timeout  10s;
    12      client_body_timeout    20s;
    13      send_timeout           20s;
    14  
    15      client_header_buffer_size    1k;
    16      large_client_header_buffers  4 4k;
    17  
    18      output_buffers   1 32k;
    19      postpone_output  1460;
    20  
    21      sendfile         on;
    22      tcp_nopush       on;
    23      tcp_nodelay      on;
    24  
    25      keepalive_timeout  75 20;
    26  
    27  
    28      server {
    29          listen 44443 default_server;
    30          server_name _; # This is just an invalid value which will never trigger on a real hostname.
    31  
    32          location / {
    33              add_header Content-Type text/plain;
    34              return 204 'OK';
    35          }
    36  
    37          access_log /dev/null;
    38          error_log /dev/null;
    39  
    40      }
    41  
    42      server {
    43          listen        44444;
    44          server_name   health_checker;
    45  
    46          location / {
    47              content_by_lua_block {
    48                  local f = io.popen("bash /var/www/health_checker/livez.sh") 
    49                  local content = f:read("*all")
    50                  f:close()
    51                  ngx.print(content)
    52              }
    53          }
    54  
    55          location /healthz {
    56              content_by_lua_block {
    57                  local f = io.popen("bash /var/www/health_checker/healthz.sh") 
    58                  local content = f:read("*all")
    59                  f:close()
    60                  ngx.print(content)
    61              }
    62          }
    63  
    64          access_log   /dev/null;
    65          error_log    /dev/null;
    66   
    67      }
    68  }