Force X-Frame-Options SAMEORIGIN for Nagios (closes #17)
parent
96e406c791
commit
9a5afd09fa
|
@ -60,11 +60,13 @@ server {
|
|||
{{ htpasswd(item.htpasswd, 1) }}
|
||||
{% endif %}
|
||||
|
||||
{% block template_headers %}
|
||||
# --> Custom headers
|
||||
{% for key, value in __headers.iteritems() %}
|
||||
add_header {{ key }} {{ value | replace(' always', '') }}{% if nginx_version.stdout | version_compare('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||
{% endfor %}
|
||||
# <-- Custom headers
|
||||
{% endblock %}
|
||||
|
||||
{% if not __location.has_key('/') %}
|
||||
location / {
|
||||
|
|
|
@ -11,6 +11,20 @@
|
|||
index index.php index.html;
|
||||
{% endblock %}
|
||||
|
||||
{% block template_headers %}
|
||||
# --> Custom headers
|
||||
{% for key, value in __headers.iteritems() %}
|
||||
{% if key == "X-Frame-Options" %}
|
||||
# X-Frame-Options forced by Ansible
|
||||
add_header {{ key }} SAMEORIGIN{% if nginx_version.stdout | version_compare('1.7.5', 'ge') %} always{% endif %};
|
||||
{% else %}
|
||||
add_header {{ key }} {{ value | replace(' always', '') }}{% if nginx_version.stdout | version_compare('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
# <-- Custom headers
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block template_local_content %}
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
|
|
Loading…
Reference in New Issue