<commit_before>upstream unicorn {
  server unix:/var/run/unicorn/shapado.sock fail_timeout=0;
}

<% if @params[:aliases] -%>
server {
  listen 80;
  server_name <% @params[:aliases].each do |a| -%><%= " #{a}" %><% end -%>;

  # Canonical host, <%= @params[:fqdn] %>
  # The "right" Nginx way - http://wiki.nginx.org/Pitfalls#Taxing_Rewrites
  rewrite ^ http://<%= @params[:fqdn] %>$request_uri? permanent;
}
<% end -%>

server {
  listen 80;
  server_name <%= @params[:fqdn] %>;

  client_max_body_size 4G;
  keepalive_timeout 5;

  root <%= @params[:shapado_path] %>/public;

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)\?[0-9]+$ {
    expires max;
    log_not_found off;
  }

  location / {
    proxy_set_header X-Forwarded_for $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    try_files $uri $uri/ @rainbows
  }

  location @rainbows {
    proxy_pass http://unicorn
  }
}<commit_msg>nginx config issues<commit_after>upstream unicorn {
  server unix:/var/run/unicorn/shapado.sock fail_timeout=0;
}

<% if @params[:aliases] -%>
server {
  listen 80;
  server_name <% @params[:aliases].each do |a| -%><%= " #{a}" %><% end -%>;

  # Canonical host, <%= @params[:fqdn] %>
  # The "right" Nginx way - http://wiki.nginx.org/Pitfalls#Taxing_Rewrites
  rewrite ^ http://<%= @params[:fqdn] %>$request_uri? permanent;
}
<% end -%>

server {
  listen 80;
  server_name <%= @params[:fqdn] %>;

  client_max_body_size 4G;
  keepalive_timeout 5;

  access_log <%= node[:nginx][:log_dir] %>/<%= @params[:fqdn] %>-access.log;
  error_log <%= node[:nginx][:log_dir] %>/<%= @params[:fqdn] %>-error.log;

  root <%= @params[:shapado_path] %>/public/;

  error_page 503 /system/maintenance.html;
  if (-f $document_root/system/maintenance.html$nocycle) { set $nocycle 1; return 503; }
  location = /system/maintenance.html { }

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)\?[0-9]+$ {
    expires max;
    log_not_found off;
  }

  location / {
    proxy_set_header X-Forwarded_for $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    proxy_pass http://unicorn;
  }
}
{'fraction_non_alphanumeric': 0.18437061300889096, 'fraction_numerical': 0.01169864295741694, 'mean_word_length': 3.9262672811059907, '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': '7481083', 'n_tokens_mistral': 921, 'n_tokens_neox': 837, 'n_words': 147}