From a0ce375254468e158aa72cbd54bd00f9a3361009 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 18 Oct 2024 17:51:13 +0200 Subject: [PATCH] Manage the chunked_transfer_encoding option in the virtualhost template. --- defaults/main.yml | 1 + templates/nginx-virthost.j2 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index bc6e9f4..6313fd0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,6 +49,7 @@ nginx_default_max_buffers_size: 16 nginx_client_header_buffer_size: '{{ nginx_default_max_buffers_size }}k' nginx_client_body_buffer_size: '{{ nginx_default_max_buffers_size }}k' nginx_large_client_header_buffers: '4 {{ nginx_default_max_buffers_size }}k' +nginx_set_chunked_transfer_encoding: false nginx_enable_compression: true nginx_gzip_vary: "on" diff --git a/templates/nginx-virthost.j2 b/templates/nginx-virthost.j2 index 2a7f9a0..57211f2 100644 --- a/templates/nginx-virthost.j2 +++ b/templates/nginx-virthost.j2 @@ -80,6 +80,9 @@ server { add_header Content-Security-Policy "frame-src{% for s in nginx_content_security_src_acl %} {{ s }}{% endfor %}; frame-ancestors{% for l in nginx_content_security_ancestor_acl %} {{ l }}{% endfor %};"; {% endif %} {% endif %} + {% if nginx_set_chunked_transfer_encoding %} + chunked_transfer_encoding on; + {% endif %} server_tokens {{ item.server_tokens | default('off') }}; {% if item.ssl_enabled and item.ssl_only %} @@ -303,6 +306,9 @@ server { add_header Content-Security-Policy "frame-src{% for s in nginx_content_security_src_acl %} {{ s }}{% endfor %}; frame-ancestors{% for l in nginx_content_security_ancestor_acl %} {{ l }}{% endfor %};"; {% endif %} {% endif %} + {% if nginx_set_chunked_transfer_encoding %} + chunked_transfer_encoding on; + {% endif %} server_tokens {{ item.server_tokens | default('off') }}; {% if nginx_cors_enabled %}