From 99f5a5836f6cc00d8a195474734e1bd70188afa5 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 6 Jun 2024 12:55:53 +0200 Subject: [PATCH] Directive proxy_hide_header Access-Control-Allow-Origin; only when cors is global. --- templates/nginx-virthost.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nginx-virthost.j2 b/templates/nginx-virthost.j2 index 68ebbf1..503641f 100644 --- a/templates/nginx-virthost.j2 +++ b/templates/nginx-virthost.j2 @@ -123,8 +123,8 @@ server { {% endif %} {% if nginx_cors_enabled %} - proxy_hide_header Access-Control-Allow-Origin; {% if nginx_cors_global %} + proxy_hide_header Access-Control-Allow-Origin; include /etc/nginx/snippets/nginx-cors.conf; {% endif %} {% endif %} @@ -307,8 +307,8 @@ server { server_tokens {{ item.server_tokens | default('off') }}; {% if nginx_cors_enabled %} - proxy_hide_header Access-Control-Allow-Origin; {% if nginx_cors_global %} + proxy_hide_header Access-Control-Allow-Origin; include /etc/nginx/snippets/nginx-cors.conf; {% endif %} {% endif %}