<commit_before>upstream <%= name %>-ssl-proxy {
  server localhost:<%= @listen_port %>;
}

server {
  server_name <%= vhost %>  <%= aliases.join(" ") unless aliases.empty? %>;

  listen              443 ssl;
  ssl_certificate     /etc/nginx/ssl/<%= vhost %>.crt;
  ssl_certificate_key /etc/nginx/ssl/<%= vhost %>.key;
  include             /etc/nginx/ssl.conf;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;

  access_log /var/log/nginx/<%= vhost %>-access.log timed_combined;
  error_log /var/log/nginx/<%= vhost %>-error.log;

  location / {
<%- if @internal_only -%>
    # Only accept connnections from internal machines
    allow 10.0.0.0/8;
    allow 127.0.0.1;
    deny all;
<%- end -%>
    proxy_pass https://<%= name %>-ssl-proxy;
  }
}<commit_msg>Allow office IP to access app loadbalancers<commit_after>upstream <%= name %>-ssl-proxy {
  server localhost:<%= @listen_port %>;
}

server {
  server_name <%= vhost %>  <%= aliases.join(" ") unless aliases.empty? %>;

  listen              443 ssl;
  ssl_certificate     /etc/nginx/ssl/<%= vhost %>.crt;
  ssl_certificate_key /etc/nginx/ssl/<%= vhost %>.key;
  include             /etc/nginx/ssl.conf;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_redirect off;

  access_log /var/log/nginx/<%= vhost %>-access.log timed_combined;
  error_log /var/log/nginx/<%= vhost %>-error.log;

  location / {
<%- if @internal_only -%>
    # Only accept connnections from internal machines
    allow 10.0.0.0/8;
    # Office IP when on CDN02
    allow 172.16.31.10;
    # Office IP when on CDN02_test
    allow 192.168.3.11;
    allow 127.0.0.1;
    deny all;
<%- end -%>
    proxy_pass https://<%= name %>-ssl-proxy;
  }
}
{'fraction_non_alphanumeric': 0.1514386673397274, 'fraction_numerical': 0.02624936900555275, 'mean_word_length': 3.0366598778004072, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '5317586', 'n_tokens_mistral': 823, 'n_tokens_neox': 743, 'n_words': 156}