<commit_before>#
# This file is managed by Puppet. Local edits will be lost.
#

upstream elasticsearch {
  server 127.0.0.1:9200;
  keepalive 15;
}

<% if @ssl %>
server {
  listen          80;
  server_name     <%= @server_name %>;

  return          301 https://$server_name$request_uri;
}
<% end %>

server {
  <% if @ssl %>
    <%= scope.function_template(['hdo/nginx-ssl-conf.erb']) %>
  <% else %>
    listen       80;
  <% end %>

  server_name    <%= @server_name %>;
  autoindex      off;

  access_log  /opt/nginx/logs/<%= @server_name %>.access.log combined;
  error_log   /opt/nginx/logs/<%= @server_name %>.error.log;

  location ~* ^(/[\w_]+/_search) {
    <% if @cors %>
      <%= scope.function_template(['hdo/nginx-cors.conf']) %>
    <% end %>

    proxy_pass                http://elasticsearch;
    proxy_http_version        1.1;
    proxy_set_header          Connection "Keep-Alive";
    proxy_set_header          Proxy-Connection "Keep-Alive";
    proxy_redirect            off;

    proxy_cache_key           "$scheme://$host$uri$is_args$args";
    proxy_cache               hdo;
    proxy_cache_bypass        $http_cache_control; # respect Cache-Control=no-cache from the client
    proxy_cache_use_stale     updating; # error timeout invalid_header updating
    proxy_cache_purge         PURGE from all;<commit_msg>Allow - in search proxy index<commit_after>#
# This file is managed by Puppet. Local edits will be lost.
#

upstream elasticsearch {
  server 127.0.0.1:9200;
  keepalive 15;
}

<% if @ssl %>
server {
  listen          80;
  server_name     <%= @server_name %>;

  return          301 https://$server_name$request_uri;
}
<% end %>

server {
  <% if @ssl %>
    <%= scope.function_template(['hdo/nginx-ssl-conf.erb']) %>
  <% else %>
    listen       80;
  <% end %>

  server_name    <%= @server_name %>;
  autoindex      off;

  access_log  /opt/nginx/logs/<%= @server_name %>.access.log combined;
  error_log   /opt/nginx/logs/<%= @server_name %>.error.log;

  location ~* ^(/[\w_-]+/_search) {
    <% if @cors %>
      <%= scope.function_template(['hdo/nginx-cors.conf']) %>
    <% end %>

    proxy_pass                http://elasticsearch;
    proxy_http_version        1.1;
    proxy_set_header          Connection "Keep-Alive";
    proxy_set_header          Proxy-Connection "Keep-Alive";
    proxy_redirect            off;

    proxy_cache_key           "$scheme://$host$uri$is_args$args";
    proxy_cache               hdo;
    proxy_cache_bypass        $http_cache_control; # respect Cache-Control=no-cache from the client
    proxy_cache_use_stale     updating; # error timeout invalid_header updating
    proxy_cache_purge         PURGE from all;
{'fraction_non_alphanumeric': 0.13348164627363737, 'fraction_numerical': 0.01557285873192436, 'mean_word_length': 2.4065656565656566, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '5006608', 'n_tokens_mistral': 970, 'n_tokens_neox': 892, 'n_words': 181}