<commit_before># Nginx config generated from template:
# Domain name: {{ conf.domain.domain_name }}
# Origin:      {{ conf.domain.origin }}
{% if nginx.user %}
user {{ nginx.user }};
{% else %}
#user ubuntu;
{% endif %}
worker_processes auto;
pid {{ plat.pid }};
worker_rlimit_nofile {{ nginx.worker_rlimit_nofile if nginx.worker_rlimit_nofile else "30000" }};

events {
    worker_connections {{ nginx.worker_connections if nginx.worker_connections else "30000" }};
    # multi_accept on;
}

http {
    # Json is king. Making it the default return type for all http responses.
    default_type application/json;

    ##
    # Basic Settings
    ##

    map_hash_max_size 32768;
    map_hash_bucket_size 256;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include {{ plat.etc }}/nginx/mime.types;


    ##
    # Logging Settings
    ##
    # Use special log log_format
    log_format jsonlog '{'
        '"timestamp": "$msec",'
        '"remote_addr": "$remote_addr",'
        '"tier": "{{ conf.tier.tier_name }}",'
        '"hostname": "$hostname",'
        '"drift_api_key": "$http_drift_api_key",'
        '"server_name": "$server_name",'
        '"host": "$host",'
        '"request": "$request",'<commit_msg>Patching up a problem where clients abort the connection and then Nginx closes the connection without telling uwsgi to abort.<commit_after># Nginx config generated from template:
# Domain name: {{ conf.domain.domain_name }}
# Origin:      {{ conf.domain.origin }}
{% if nginx.user %}
user {{ nginx.user }};
{% else %}
#user ubuntu;
{% endif %}
worker_processes auto;
pid {{ plat.pid }};
worker_rlimit_nofile {{ nginx.worker_rlimit_nofile if nginx.worker_rlimit_nofile else "30000" }};

events {
    worker_connections {{ nginx.worker_connections if nginx.worker_connections else "30000" }};
    # multi_accept on;
}

http {
    # Json is king. Making it the default return type for all http responses.
    default_type application/json;

    ##
    # Basic Settings
    ##

    map_hash_max_size 32768;
    map_hash_bucket_size 256;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    # A possible fix to a problem described here: 
    # https://stackoverflow.com/questions/34768527/uwsgi-ioerror-write-error
    uwsgi_ignore_client_abort on;

    include {{ plat.etc }}/nginx/mime.types;


    ##
    # Logging Settings
    ##
    # Use special log log_format
    log_format jsonlog '{'
        '"timestamp": "$msec",'
        '"remote_addr": "$remote_addr",'
        '"tier": "{{ conf.tier.tier_name }}",'
        '"hostname": "$hostname",'
        '"drift_api_key": "$http_drift_api_key",'
        '"server_name": "$server_name",'
        '"host": "$host",'
        '"request": "$request",'
{'fraction_non_alphanumeric': 0.1297208538587849, 'fraction_numerical': 0.019704433497536946, 'mean_word_length': 3.2364394993045895, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3712661', 'n_tokens_mistral': 1103, 'n_tokens_neox': 994, 'n_words': 235}