mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -115,6 +115,7 @@ server {
|
|||||||
location ~* (fonts|assets|plugins|uploads)/.*\.(eot|ttf|woff|woff2|ico|otf)$ {
|
location ~* (fonts|assets|plugins|uploads)/.*\.(eot|ttf|woff|woff2|ico|otf)$ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control public,immutable;
|
add_header Cache-Control public,immutable;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /srv/status {
|
location = /srv/status {
|
||||||
@@ -134,6 +135,7 @@ server {
|
|||||||
location ~ ^/javascripts/ {
|
location ~ ^/javascripts/ {
|
||||||
expires 1d;
|
expires 1d;
|
||||||
add_header Cache-Control public,immutable;
|
add_header Cache-Control public,immutable;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/assets/(?<asset_path>.+)$ {
|
location ~ ^/assets/(?<asset_path>.+)$ {
|
||||||
@@ -150,12 +152,14 @@ server {
|
|||||||
location ~ ^/plugins/ {
|
location ~ ^/plugins/ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control public,immutable;
|
add_header Cache-Control public,immutable;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
}
|
}
|
||||||
|
|
||||||
# cache emojis
|
# cache emojis
|
||||||
location ~ /images/emoji/ {
|
location ~ /images/emoji/ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control public,immutable;
|
add_header Cache-Control public,immutable;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/uploads/ {
|
location ~ ^/uploads/ {
|
||||||
@@ -253,7 +257,6 @@ server {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_header Access-Control-Allow-Origin *;
|
|
||||||
# this means every file in public is tried first
|
# this means every file in public is tried first
|
||||||
try_files $uri @discourse;
|
try_files $uri @discourse;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user