Browse Source

added frame options header, default SAMEORIGIN

Fabian Peter Hammerle 8 năm trước cách đây
mục cha
commit
3cf38971aa
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      templates/vhosts.j2

+ 5 - 0
templates/vhosts.j2

@@ -3,6 +3,7 @@
 {%- set vhost = x509.vhost -%}
 {%- set vhost = x509.vhost -%}
 {%- set ssl = vhost.ssl | default(false) -%}
 {%- set ssl = vhost.ssl | default(false) -%}
 {%- set php_fastcgi = vhost.php_fastcgi | default(false) -%}
 {%- set php_fastcgi = vhost.php_fastcgi | default(false) -%}
+{%- set frame_options = vhost.frame_options | default('SAMEORIGIN') -%}
 
 
 server {
 server {
 
 
@@ -49,6 +50,10 @@ server {
     error_log {{ vhost.error_log }} error;
     error_log {{ vhost.error_log }} error;
 {% endif %}
 {% endif %}
 
 
+{% if frame_options %}
+    add_header X-Frame-Options {{frame_options}};
+{% endif %}
+
 {% if vhost.return is defined %}
 {% if vhost.return is defined %}
     return {{ vhost.return }};
     return {{ vhost.return }};
 {% endif %}
 {% endif %}