<commit_before>upstream unicorn_<%= node[:application] %> {
 # This is the socket we configured in unicorn.rb
 server unix:<%= node[:shared_path] %>/sockets/unicorn.sock
 fail_timeout=0;
}

server {
  server_name <%= node[:railsapp][:server_names] %>;
  listen 80;

  root <%= node[:current_path] %>/public;

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s;

    # If you don't find the filename in the static files
    # Then request it from the unicorn server
    if (!-f $request_filename) {
      proxy_pass http://unicorn_<%= node[:application] %>;
      break;
    }
  }

  location ~* \.(js|css|png|jpg|gif)$ {
    if ($query_string ~ "^[0-9]+$") {
      access_log off;
      expires max;
      add_header Cache-Control public;
    }
  }
}

<% if node[:railsapp][:ssl] %>
server {
  listen       443;
  server_name  <%= node[:railsapp][:server_names] %>;

  ssl on;
  ssl_protocols   SSLv3 TLSv1;
  ssl_certificate <%= node[:current_path] %>/<%= node[:railsapp][:ssl_crt_path] %>;
  ssl_certificate_key <%= node[:current_path] %>/<%= node[:railsapp][:ssl_key_path] %>;

  proxy_set_header  X-FORWARDED_PROTO https;

  root <%= node[:current_path] %>/public;
  
  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s;
    
    # If you don't find the filename in the static files
    # Then request it from the unicorn server
    if (!-f $request_filename) {
      proxy_pass http://unicorn_<%= node[:application] %>;
      break;
    }
  }
}
<% end %><commit_msg>nginx cache for all assets<commit_after>upstream unicorn_<%= node[:application] %> {
 # This is the socket we configured in unicorn.rb
 server unix:<%= node[:shared_path] %>/sockets/unicorn.sock
 fail_timeout=0;
}

server {
  server_name <%= node[:railsapp][:server_names] %>;
  listen 80;

  root <%= node[:current_path] %>/public;

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s;

    # If you don't find the filename in the static files
    # Then request it from the unicorn server
    if (!-f $request_filename) {
      proxy_pass http://unicorn_<%= node[:application] %>;
      break;
    }
  }

  location ~ ^/(assets)/  {
    gzip_static on;
    access_log off;
    expires max;
    add_header Cache-Control public;
    add_header Last-Modified "";
    add_header ETag "";
  }
}

<% if node[:railsapp][:ssl] %>
server {
  listen       443;
  server_name  <%= node[:railsapp][:server_names] %>;

  ssl on;
  ssl_protocols   SSLv3 TLSv1;
  ssl_certificate <%= node[:current_path] %>/<%= node[:railsapp][:ssl_crt_path] %>;
  ssl_certificate_key <%= node[:current_path] %>/<%= node[:railsapp][:ssl_key_path] %>;

  proxy_set_header  X-FORWARDED_PROTO https;

  root <%= node[:current_path] %>/public;

  location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_read_timeout <%= node[:railsapp][:request_timeout] %>s;

    # If you don't find the filename in the static files
    # Then request it from the unicorn server
    if (!-f $request_filename) {
      proxy_pass http://unicorn_<%= node[:application] %>;
      break;
    }
  }
}
<% end %>
{'fraction_non_alphanumeric': 0.1419408812046849, 'fraction_numerical': 0.0050195203569436695, 'mean_word_length': 3.6827676240208875, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '929085', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1219, 'n_words': 273}