<commit_before>upstream <%= application %> {
  server unix:/tmp/<%= application %>.sock fail_timeout=0;
}

<% if nginx_use_ssl %>
server {
  listen 80;
  server_name <%= nginx_server_name %>;
  rewrite ^(.*) https://$server_name$2 permanent;
}
<% end %>

server {
<% if nginx_use_ssl %>
  listen 443;
  ssl on;
  ssl_certificate /etc/ssl/certs/<%= nginx_ssl_certificate %>;
  ssl_certificate_key /etc/ssl/private/<%= nginx_ssl_certificate_key %>;
<% else %>
  listen 80;
<% end %>

  server_name <%= nginx_server_name %>;
  root <%= current_path %>/public;
  try_files $uri/index.html $uri @<%= application %>;

  location @<%= application %> {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
<% if nginx_use_ssl %><commit_msg>Nginx: use return 301 instead of rewrite for http->https redirect<commit_after>upstream <%= application %> {
  server unix:/tmp/<%= application %>.sock fail_timeout=0;
}

<% if nginx_use_ssl %>
server {
  listen 80;
  server_name <%= nginx_server_name %>;
  return 301 https://<%= nginx_server_name %>$request_uri;
}
<% end %>

server {
<% if nginx_use_ssl %>
  listen 443;
  ssl on;
  ssl_certificate /etc/ssl/certs/<%= nginx_ssl_certificate %>;
  ssl_certificate_key /etc/ssl/private/<%= nginx_ssl_certificate_key %>;
<% else %>
  listen 80;
<% end %>

  server_name <%= nginx_server_name %>;
  root <%= current_path %>/public;
  try_files $uri/index.html $uri @<%= application %>;

  location @<%= application %> {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
<% if nginx_use_ssl %>
{'fraction_non_alphanumeric': 0.15301852958756723, 'fraction_numerical': 0.013747758517632994, 'mean_word_length': 4.452768729641694, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 35, 'https://': 2, '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': '2975574', 'n_tokens_mistral': 702, 'n_tokens_neox': 596, 'n_words': 123}