<commit_before>upstream <%= @vhost %>-upstream {
<%- @servers.each do |server| -%>
  server <%= server -%>:<%= @port %> max_fails=3 fail_timeout=10s;
<%- end -%>
}

server {
  listen localhost:<%= @port %>;

  # Needed to do keepalives upstream
  proxy_http_version 1.1;

  # Try next upstream if one returns an error
  proxy_next_upstream error timeout http_500 http_502 http_503 http_504;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;

  proxy_read_timeout <%= @read_timeout %>;

  # No need to set this limit here, as long as it is enforced by servers
  # behind the load balancers.
  client_max_body_size 4g;

  access_log /var/log/nginx/<%= @vhost %>-access.log timed_combined;
  access_log /var/log/nginx/<%= @vhost %>-json.event.access.log json_event;
  error_log /var/log/nginx/<%= @vhost %>-error.log;

  location / {
    # Only accept connnections over loopback.
    allow 127.0.0.1;
    deny all;
    proxy_pass https://<%= @vhost %>-upstream;
  }
}
<commit_msg>[#50887571] Amend comment in es proxy template<commit_after>upstream <%= @vhost %>-upstream {
<%- @servers.each do |server| -%>
  server <%= server -%>:<%= @port %> max_fails=3 fail_timeout=10s;
<%- end -%>
}

server {
  listen localhost:<%= @port %>;

  # Needed to do keepalives upstream
  proxy_http_version 1.1;

  # Try next upstream if one returns an error
  proxy_next_upstream error timeout http_500 http_502 http_503 http_504;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;

  proxy_read_timeout <%= @read_timeout %>;

  # Don't restrict the size of queries or documents.
  client_max_body_size 4g;

  access_log /var/log/nginx/<%= @vhost %>-access.log timed_combined;
  access_log /var/log/nginx/<%= @vhost %>-json.event.access.log json_event;
  error_log /var/log/nginx/<%= @vhost %>-error.log;

  location / {
    # Only accept connnections over loopback.
    allow 127.0.0.1;
    deny all;
    proxy_pass https://<%= @vhost %>-upstream;
  }
}

{'fraction_non_alphanumeric': 0.1320921985815603, 'fraction_numerical': 0.024822695035460994, 'mean_word_length': 3.917211328976035, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4151227', 'n_tokens_mistral': 915, 'n_tokens_neox': 820, 'n_words': 201}