<commit_before># UPSTREAM RAILS
# this can be any application server, not just Unicorn/Rainbows!
upstream rails_<%= @app_server["name"] %> {
  # fail_timeout=0 means we always retry an upstream even if it failed
  # to return a good HTTP response (in case the Unicorn master nukes a
  # single worker for timing out).

  # for UNIX domain socket setups:
  # serverr unix:<%= @rails_root %>/shared/tmp/sockets/<%= @app_server["name"] %>.sock fail_timeout=0;
  <% (0...node["application"]["app_server"]["concurrency"].to_i).each do |num| %>
  server 127.0.0.1:<%= num + 3000 %> fail_timeout=0;
  <% end %>
}

# HTTP
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 80 default;

  # sets the domain[s] that this vhost server requests for
  server_name <%= @server_names.join(" ") %>;

  <% if @use_ssl && @force_ssl %>
    # redirect all requests to SSL
    rewrite ^(.*) https://$server_name$1 permanent;
  <% else %>
    # include application specific configuration
    include <%= @nginx_dir %>/applications/<%= "#{@name}-#{@rails_env}" %>.conf;
  <% end %>
}

<% if @use_ssl %>
# HTTPS
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 443 default ssl;

  server_name <%= @server_names.join(" ") %>;

  # SSL settings
  ssl                         on;
  ssl_certificate             <%= @ssl_cert %>;
  ssl_certificate_key         <%= @ssl_key %>;
  ssl_protocols               SSLv3 TLSv1;
  ssl_ciphers                 ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  ssl_prefer_server_ciphers   on;
  keepalive_timeout           65;

  proxy_set_header X-Forwarded-Proto https;
  proxy_set_header Content-Length $content_length;

  # include application specific configuration
  include <%= @nginx_dir %>/applications/<%= "#{@name}-#{@rails_env}" %>.conf;
}<commit_msg>Keep the current hostname during redirects.<commit_after># UPSTREAM RAILS
# this can be any application server, not just Unicorn/Rainbows!
upstream rails_<%= @app_server["name"] %> {
  # fail_timeout=0 means we always retry an upstream even if it failed
  # to return a good HTTP response (in case the Unicorn master nukes a
  # single worker for timing out).

  # for UNIX domain socket setups:
  # serverr unix:<%= @rails_root %>/shared/tmp/sockets/<%= @app_server["name"] %>.sock fail_timeout=0;
  <% (0...node["application"]["app_server"]["concurrency"].to_i).each do |num| %>
  server 127.0.0.1:<%= num + 3000 %> fail_timeout=0;
  <% end %>
}

# HTTP
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 80 default;

  # sets the domain[s] that this vhost server requests for
  server_name <%= @server_names.join(" ") %>;

  <% if @use_ssl && @force_ssl %>
    # redirect all requests to SSL
    rewrite ^(.*) https://$host$1 permanent;
  <% else %>
    # include application specific configuration
    include <%= @nginx_dir %>/applications/<%= "#{@name}-#{@rails_env}" %>.conf;
  <% end %>
}

<% if @use_ssl %>
# HTTPS
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 443 default ssl;

  server_name <%= @server_names.join(" ") %>;

  # SSL settings
  ssl                         on;
  ssl_certificate             <%= @ssl_cert %>;
  ssl_certificate_key         <%= @ssl_key %>;
  ssl_protocols               SSLv3 TLSv1;
  ssl_ciphers                 ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  ssl_prefer_server_ciphers   on;
  keepalive_timeout           65;

  proxy_set_header X-Forwarded-Proto https;
  proxy_set_header Content-Length $content_length;

  # include application specific configuration
  include <%= @nginx_dir %>/applications/<%= "#{@name}-#{@rails_env}" %>.conf;
}
{'fraction_non_alphanumeric': 0.14441120478651073, 'fraction_numerical': 0.015229806907805276, 'mean_word_length': 3.342384887839433, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '3316149', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1222, 'n_words': 339}