<commit_before>include <%= latest_release %>/config/nginx/ssl_terminator.conf;

upstream api_umbrella_web_backend {
  server 127.0.0.1:51000;
  keepalive 10;
}

upstream api_umbrella_gatekeeper_frontend {
  server 127.0.0.1:50090;
  keepalive 10;
}

include <%= current_path %>/config/gatekeeper_nginx.conf;

server {
  listen 80;
  server_name <%= all_domains.join(" ") %>;

  access_log <%= current_path %>/log/access.log combined;
  error_log <%= current_path %>/log/error.log;

  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  # Proxy over HTTP 1.1 so keepalive connections to the backend are supported.
  proxy_http_version 1.1;
  proxy_set_header Connection "";

  # Conditional proxy headers. Don't set these x-forwarded headers if they've
  # already been set (by the SSL terminator).
  set $real_scheme $http_x_forwarded_proto;
  if ($real_scheme = "") {
    set $real_scheme $scheme; 
  }

  set $real_port $http_x_forwarded_port;
  if ($real_port = "") {
    set $real_port $server_port; 
  }

  proxy_set_header X-Forwarded-Proto $real_scheme;
  proxy_set_header X-Forwarded-Port $real_port;

  location ~* ^/(about|community|doc|docs|images|static|)(/|$) {
    proxy_pass http://api_umbrella_web_backend;
  }

  location ~* ^/(account|admin|admins|assets|contact|favicon\.ico|javascripts|robots.txt|signup)(/|$) {
    proxy_pass http://api_umbrella_web_backend;
  }

  location / {
    proxy_pass http://api_umbrella_gatekeeper_frontend;
  }
}
<commit_msg>Fix nginx configuration when gatekeeper hasn't yet generates config.<commit_after>include <%= latest_release %>/config/nginx/ssl_terminator.conf;

upstream api_umbrella_web_backend {
  server 127.0.0.1:51000;
  keepalive 10;
}

upstream api_umbrella_gatekeeper_frontend {
  server 127.0.0.1:50090;
  keepalive 10;
}

include <%= current_path %>/config/gatekeeper_nginx*.conf;

server {
  listen 80;
  server_name <%= all_domains.join(" ") %>;

  access_log <%= current_path %>/log/access.log combined;
  error_log <%= current_path %>/log/error.log;

  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  # Proxy over HTTP 1.1 so keepalive connections to the backend are supported.
  proxy_http_version 1.1;
  proxy_set_header Connection "";

  # Conditional proxy headers. Don't set these x-forwarded headers if they've
  # already been set (by the SSL terminator).
  set $real_scheme $http_x_forwarded_proto;
  if ($real_scheme = "") {
    set $real_scheme $scheme; 
  }

  set $real_port $http_x_forwarded_port;
  if ($real_port = "") {
    set $real_port $server_port; 
  }

  proxy_set_header X-Forwarded-Proto $real_scheme;
  proxy_set_header X-Forwarded-Port $real_port;

  location ~* ^/(about|community|doc|docs|images|static|)(/|$) {
    proxy_pass http://api_umbrella_web_backend;
  }

  location ~* ^/(account|admin|admins|assets|contact|favicon\.ico|javascripts|robots.txt|signup)(/|$) {
    proxy_pass http://api_umbrella_web_backend;
  }

  location / {
    proxy_pass http://api_umbrella_gatekeeper_frontend;
  }
}

{'fraction_non_alphanumeric': 0.12200647249190938, 'fraction_numerical': 0.020711974110032363, 'mean_word_length': 4.519642857142857, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5738858', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1089, 'n_words': 212}