<commit_before>daemon off;

worker_processes <%= ENV["NGINX_WORKERS"] || 4 %>;

events {
  use epoll;
  accept_mutex on;
  worker_connections 1024;
}

http {
  gzip on;
  gzip_comp_level 2;
  gzip_min_length 512;

  server_tokens off;

  log_format l2met "measure#nginx.service=$request_time request_id=$http_x_request_id";
  access_log logs/nginx/access.log l2met;
  error_log logs/nginx/error.log;

  include mime.types;
  default_type application/octet-stream;
  sendfile on;

  server {
    listen <%= ENV["PORT"] %>;
    server_name _;
    keepalive_timeout 5;
    root dist;
    index index.html;

    <% if ENV["BASIC_AUTH_USER"] && ENV["BASIC_AUTH_PASSWORD"] %>
      auth_basic "Restricted";
      auth_basic_user_file <%= "#{ENV["HOME"]}/config/htpasswd" %>;
    <% end %>

    location / {
      expires off;

      if (!-e $request_filename){
        rewrite ^(.*)$ /index.html break;
      }
    }

    location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|html|txt|htm)$ {
      expires max;
      log_not_found off;
      access_log off;
      add_header Cache-Control public;
      fastcgi_hide_header Set-Cookie;
    }

    location ~* "^.*?\.(eot)|(ttf)|(woff)$" {
      add_header Access-Control-Allow-Origin *;
    }

    <% if ENV["API_URL"] %>
      location <%= ENV["API_PREFIX_PATH"] || "/api/" %> {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass <%= ENV["API_URL"] %>;
        proxy_ssl_session_reuse off;
        proxy_set_header Host $http_host;
        proxy_redirect off;
      }
    <% end %>
  }
}
<commit_msg>trying to fix the proxy passing<commit_after>daemon off;

worker_processes <%= ENV["NGINX_WORKERS"] || 4 %>;

events {
  use epoll;
  accept_mutex on;
  worker_connections 1024;
}

http {
  gzip on;
  gzip_comp_level 2;
  gzip_min_length 512;

  server_tokens off;

  log_format l2met "measure#nginx.service=$request_time request_id=$http_x_request_id";
  access_log logs/nginx/access.log l2met;
  error_log logs/nginx/error.log;

  include mime.types;
  default_type application/octet-stream;
  sendfile on;

  <% if ENV["API_URL"] %>
    upstream api_server {
      server <%= ENV["API_URL"] %>;
    }
  <% end %>

  server {
    listen <%= ENV["PORT"] %>;
    server_name _;
    keepalive_timeout 5;
    root dist;
    index index.html;

    <% if ENV["BASIC_AUTH_USER"] && ENV["BASIC_AUTH_PASSWORD"] %>
      auth_basic "Restricted";
      auth_basic_user_file <%= "#{ENV["HOME"]}/config/htpasswd" %>;
    <% end %>

    location / {
      expires off;

      if (!-e $request_filename){
        rewrite ^(.*)$ /index.html break;
      }
    }

    location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|html|txt|htm)$ {
      expires max;
      log_not_found off;
      access_log off;
      add_header Cache-Control public;
      fastcgi_hide_header Set-Cookie;
    }

    location ~* "^.*?\.(eot)|(ttf)|(woff)$" {
      add_header Access-Control-Allow-Origin *;
    }

    <% if ENV["API_URL"] %>
      location <%= ENV["API_PREFIX_PATH"] || "/api/" %> {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://api_server/;
        proxy_ssl_session_reuse off;
        proxy_set_header Host $http_host;
        proxy_redirect off;
      }
    <% end %>
  }
}

{'fraction_non_alphanumeric': 0.14437772925764192, 'fraction_numerical': 0.007641921397379912, 'mean_word_length': 3.1041433370660694, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '4187491', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1372, 'n_words': 220}