<commit_before><% if @nginx_http_only != '' -%>
<% else -%>
server {
    listen 80;
    return 301 https://$host$request_uri;
}
<% end -%>

include /etc/nginx/zulip-include/upstreams;

server {
<% if @nginx_http_only != '' -%>
    listen 80;
<% else -%>
    listen 443;

    ssl on;
    ssl_certificate <%= @ssl_dir %>/certs/zulip.combined-chain.crt;
    ssl_certificate_key <%= @ssl_dir %>/private/zulip.key;
<% end -%>

<% if @no_serve_uploads == '' -%>
    location /user_avatars {
        add_header X-Content-Type-Options nosniff;
        add_header Content-Security-Policy "default-src 'none' img-src 'self'";
        include /etc/nginx/zulip-include/uploads.types;
        alias /home/zulip/uploads/avatars;
    }
<% end -%>

    location /local-static {
        alias /home/zulip/local-static;
    }

    include /etc/nginx/zulip-include/certbot;
    include /etc/nginx/zulip-include/app;
<% if @no_serve_uploads == '' -%>
    include /etc/nginx/zulip-include/uploads.route;
<% end -%>
}
<commit_msg>puppet: Add IPv6 support to standard nginx listen directives.<commit_after><% if @nginx_http_only != '' -%>
<% else -%>
server {
    listen 80;
    listen [::]:80;
    return 301 https://$host$request_uri;
}
<% end -%>

include /etc/nginx/zulip-include/upstreams;

server {
<% if @nginx_http_only != '' -%>
    listen 80;
    listen [::]:80;
<% else -%>
    listen 443;
    listen [::]:443;

    ssl on;
    ssl_certificate <%= @ssl_dir %>/certs/zulip.combined-chain.crt;
    ssl_certificate_key <%= @ssl_dir %>/private/zulip.key;
<% end -%>

<% if @no_serve_uploads == '' -%>
    location /user_avatars {
        add_header X-Content-Type-Options nosniff;
        add_header Content-Security-Policy "default-src 'none' img-src 'self'";
        include /etc/nginx/zulip-include/uploads.types;
        alias /home/zulip/uploads/avatars;
    }
<% end -%>

    location /local-static {
        alias /home/zulip/local-static;
    }

    include /etc/nginx/zulip-include/certbot;
    include /etc/nginx/zulip-include/app;
<% if @no_serve_uploads == '' -%>
    include /etc/nginx/zulip-include/uploads.route;
<% end -%>
}

{'fraction_non_alphanumeric': 0.17223529411764707, 'fraction_numerical': 0.013176470588235295, 'mean_word_length': 2.8100358422939067, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '5448974', 'n_tokens_mistral': 881, 'n_tokens_neox': 801, 'n_words': 136}