<commit_before>server {
  listen   <%= node.elasticsearch[:nginx][:port] %>;
  server_name  elasticsearch;
  client_max_body_size <%= node.elasticsearch[:nginx][:client_max_body_size] %>;

  error_log   <%= node.elasticsearch[:nginx][:log_dir] %>/elasticsearch-errors.log;
  access_log  <%= node.elasticsearch[:nginx][:log_dir] %>/elasticsearch.log;

  location <%= node.elasticsearch[:nginx][:location] %> {

    # Deny Nodes Shutdown API
    if ($request_filename ~ "_shutdown") {
      return 403;
      break;
    }

<% unless node.elasticsearch[:nginx][:allow_cluster_api] %>
    # Deny access to Cluster API
    if ($request_filename ~ "_cluster") {
      return 403;
      break;
    }
<% end %>

    # Pass requests to ElasticSearch
    proxy_pass http://<%= node.elasticsearch.network.host rescue 'localhost' %>:<%= node.elasticsearch.http.port rescue '9200' %>/;
    proxy_redirect off;

    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  Host $http_host;

    # For CORS Ajax
    proxy_pass_header Access-Control-Allow-Origin;
    proxy_pass_header Access-Control-Allow-Methods;
    proxy_hide_header Access-Control-Allow-Headers;
    add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
    add_header Access-Control-Allow-Credentials true;

<% unless node.elasticsearch[:nginx][:users].empty? %>
    # Authorize access
    auth_basic           "<PASSWORD>";
    auth_basic_user_file <%= node.elasticsearch[:nginx][:passwords_file] %>;
<% end %>

  }
<commit_msg>removed auth for elastic search<commit_after>server {
  listen   <%= node.elasticsearch[:nginx][:port] %>;
  server_name  elasticsearch;
  client_max_body_size <%= node.elasticsearch[:nginx][:client_max_body_size] %>;

  error_log   <%= node.elasticsearch[:nginx][:log_dir] %>/elasticsearch-errors.log;
  access_log  <%= node.elasticsearch[:nginx][:log_dir] %>/elasticsearch.log;

  location <%= node.elasticsearch[:nginx][:location] %> {

    # Deny Nodes Shutdown API
    if ($request_filename ~ "_shutdown") {
      return 403;
      break;
    }

<% unless node.elasticsearch[:nginx][:allow_cluster_api] %>
    # Deny access to Cluster API
    if ($request_filename ~ "_cluster") {
      return 403;
      break;
    }
<% end %>

    # Pass requests to ElasticSearch
    proxy_pass http://<%= node.elasticsearch.network.host rescue 'localhost' %>:<%= node.elasticsearch.http.port rescue '9200' %>/;
    proxy_redirect off;

    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  Host $http_host;

    # For CORS Ajax
    proxy_pass_header Access-Control-Allow-Origin;
    proxy_pass_header Access-Control-Allow-Methods;
    proxy_hide_header Access-Control-Allow-Headers;
    add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
    add_header Access-Control-Allow-Credentials true;

  }

{'fraction_non_alphanumeric': 0.13185334678775648, 'fraction_numerical': 0.006727211570803902, 'mean_word_length': 3.9815745393634843, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '7591098', 'n_tokens_mistral': 1004, 'n_tokens_neox': 960, 'n_words': 169}