diff --git a/README.md b/README.md index f742feb..c47e669 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,8 @@ nginx_main_template: access_log_location: - name: main location: /var/log/nginx/access.log + tcp_nopush: true + tcp_nodelay: true keepalive_timeout: 65 cache: false rate_limit: false diff --git a/defaults/main.yml b/defaults/main.yml index 864e1aa..263e499 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -168,6 +168,8 @@ nginx_main_template: access_log_location: - name: main location: /var/log/nginx/access.log + tcp_nopush: true + tcp_nodelay: true keepalive_timeout: 65 cache: false rate_limit: false diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 8a2c608..d4f7814 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -71,7 +71,13 @@ http { {% endfor %} sendfile on; - #tcp_nopush on; + +{% if nginx_main_template.http_settings.tcp_nopush is defined and nginx_main_template.tcp_nopush %} + tcp_nopush on; +{% endif %} +{% if nginx_main_template.http_settings.tcp_nodelay is defined and nginx_main_template.tcp_nodelay %} + tcp_nodelay on; +{% endif %} {% if nginx_main_template.http_settings.server_tokens is defined and nginx_main_template.http_settings.server_tokens | length %} server_tokens {{ nginx_main_template.http_settings.server_tokens }};