From 437c3485989537792a791e58f7e9329f13044418 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 25 Feb 2021 02:57:37 +0530 Subject: [PATCH] DEV: add CORS header for all nginx rules of public folder files. (#12205) * DEV: add CORS header for all nginx rules of public folder files. This reverts commit d628c65af06d4e809fde5e3825e065173517e5a1 and adding CORS header in two more places individually. --- config/nginx.sample.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 62e619e9ec0..3993ff8cc9a 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -115,6 +115,7 @@ server { location ~* (fonts|assets|plugins|uploads)/.*\.(eot|ttf|woff|woff2|ico|otf)$ { expires 1y; add_header Cache-Control public,immutable; + add_header Access-Control-Allow-Origin *; } location = /srv/status { @@ -134,6 +135,7 @@ server { location ~ ^/javascripts/ { expires 1d; add_header Cache-Control public,immutable; + add_header Access-Control-Allow-Origin *; } location ~ ^/assets/(?.+)$ { @@ -150,12 +152,14 @@ server { location ~ ^/plugins/ { expires 1y; add_header Cache-Control public,immutable; + add_header Access-Control-Allow-Origin *; } # cache emojis location ~ /images/emoji/ { expires 1y; add_header Cache-Control public,immutable; + add_header Access-Control-Allow-Origin *; } location ~ ^/uploads/ { @@ -253,7 +257,6 @@ server { break; } - add_header Access-Control-Allow-Origin *; # this means every file in public is tried first try_files $uri @discourse; }