From 145c5cdbc2e6e05af9e2628aeedf5962fcff3d2a Mon Sep 17 00:00:00 2001 From: Stepan Vladovskiy Date: Tue, 27 Feb 2024 06:05:01 -0300 Subject: [PATCH] feat: Cors with mp3 and clean up basura --- nginx.conf.sigil | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index 4b7ac043..d5c64ecd 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -48,21 +48,21 @@ server { {{ $cors_headers_get }} } - # Custom location block for /connect - # location /connect/ { - # proxy_pass http://presence-8080/; - # {{ $proxy_settings }} - # {{ $gzip_settings }} - # {{ $cors_headers_options }} - # {{ $cors_headers_post }} - # {{ $cors_headers_get }} - # } - location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { expires 30d; # This means that the client can cache these resources for 30 days. add_header Cache-Control "public, no-transform"; } + location ~* \.(mp3)$ { + if ($request_method = 'GET') { + add_header 'Access-Control-Allow-Origin' $allow_origin always; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; + add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; + } + } + error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html; location /400-error.html { @@ -88,7 +88,6 @@ server { internal; } - # include /home/dokku/gateway/nginx.conf.d/*.conf; include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; } {{ end }}