diff --git a/README.md b/README.md index c0ff3ac..4da9786 100644 --- a/README.md +++ b/README.md @@ -355,6 +355,7 @@ nginx_main_template: cache: false rate_limit: false keyval: false + #server_tokens: "off" http_global_autoindex: false #http_custom_options: [] stream_enable: false diff --git a/defaults/main.yml b/defaults/main.yml index 5f87c96..23dea21 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -166,6 +166,7 @@ nginx_main_template: cache: false rate_limit: false keyval: false + #server_tokens: "off" http_global_autoindex: false #http_custom_options: [] stream_enable: false diff --git a/molecule/template_module/playbook.yml b/molecule/template_module/playbook.yml index 1e3ed48..89e2a3b 100644 --- a/molecule/template_module/playbook.yml +++ b/molecule/template_module/playbook.yml @@ -32,6 +32,7 @@ cache: false rate_limit: false keyval: false + server_tokens: "off" stream_enable: true http_global_autoindex: false diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index c0dd7bc..8a2c608 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -73,6 +73,10 @@ http { sendfile on; #tcp_nopush on; +{% 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 }}; +{% endif %} + keepalive_timeout {{ nginx_main_template.http_settings.keepalive_timeout }}; #gzip on;