Fix "always" management in add_header directive

py3 1.6.3
Emilien Mantel 2019-08-20 10:35:16 +02:00
parent f5885c5c55
commit 993310641a
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ server {
{% block template_headers %} {% block template_headers %}
# --> Custom headers # --> Custom headers
{% for key, value in __headers.iteritems() %} {% for key, value in __headers.iteritems() %}
add_header {{ key }} "{{ value }}"; add_header {{ key }} "{{ value | regex_replace('\s+always$', '') }}"{% if value | regex_search('\s+always$') %} always{% endif %};
{% endfor %} {% endfor %}
# <-- Custom headers # <-- Custom headers
{% endblock %} {% endblock %}

View File

@ -46,6 +46,6 @@ nginx_templates_no_dir:
nginx_servers_default_headers: nginx_servers_default_headers:
'X-Frame-Options': 'DENY always' 'X-Frame-Options': 'DENY always'
'X-Content-Type-Options': 'nosniff always' 'X-Content-Type-Options': 'nosniff always'
'X-XSS-Protection': '1; mode=block' 'X-XSS-Protection': '1; mode=block always'
nginx_acmesh_bin: "{{ nginx_acmesh_dir }}/acme.sh" nginx_acmesh_bin: "{{ nginx_acmesh_dir }}/acme.sh"