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 d628c65af0 and adding CORS header in two more places individually.
This commit is contained in:
Vinoth Kannan 2021-02-25 02:57:37 +05:30 committed by GitHub
parent 7fa7bf61d5
commit 437c348598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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/(?<asset_path>.+)$ {
@ -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;
}