add server.add_headers option
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2021-05-20 15:10:01 +02:00
parent bff417a33a
commit 00f7bd4076
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 12 additions and 4 deletions

View File

@ -159,14 +159,15 @@ nginx_vhosts_default:
# dhparam:
# client_max_body_size:
# send_timeout:
# add_headers:
# - name:
# value:
# always: True
# locations:
# - match: /
# root: /var/www/vhosts/default
# index: index.html
# add_headers:
# - name:
# value:
# always: True
# add_headers: []
# proxy_pass:
# proxy_http_version: "1.1"
# proxy_buffering: "off"

View File

@ -37,6 +37,13 @@ server {
{% if server.send_timeout is defined and server.send_timeout %}
send_timeout {{ server.send_timeout }};
{% endif %}
{% if server.add_headers is defined and server.add_headers %}
include /etc/nginx/conf.d/header.conf;
{% for add in server.add_headers %}
add_header {{ add.name }} {{ add.value }}{{ " always" if add.always | default(True) | bool else "" }};
{% endfor %}
{% endif %}
{% if server.custom_options is defined and server.custom_options %}
{% for inline_option in server.custom_options %}