From 1507c2150fd4dea625b715f7a5a9e5c638ac32f4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 2 Jun 2020 15:02:33 +0200 Subject: [PATCH] switching to more_set_headers --- conf/nginx.conf | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index a90e797..719ebe8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ more_set_headers "X-Frame-Options : ALLOWALL"; # Bypass PeerTube for performance reasons. Could be removed location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { - add_header Cache-Control "public, max-age=31536000, immutable"; + more_set_headers "Cache-Control : public, max-age=31536000, immutable"; alias __FINALPATH__/client/dist/$1; } @@ -10,21 +10,21 @@ location ~ ^/client/(.*\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$ { # Bypass PeerTube for performance reasons. Could be removed location ~ ^/static/(thumbnails|avatars)/ { if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; + more_set_headers "Access-Control-Allow-Origin : *"; + more_set_headers "Access-Control-Allow-Methods : GET, OPTIONS"; + more_set_headers "Access-Control-Allow-Headers : Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"; + more_set_headers "Access-Control-Max-Age : 1728000"; + more_set_headers "Content-Type : text/plain charset=UTF-8"; + more_set_headers "Content-Length : 0"; return 204; } - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + more_set_headers "Access-Control-Allow-Origin : *"; + more_set_headers "Access-Control-Allow-Methods : GET, OPTIONS"; + more_set_headers "Access-Control-Allow-Headers : Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"; # Cache 2 hours - add_header Cache-Control "public, max-age=7200"; + more_set_headers "Cache-Control : public, max-age=7200"; root /home/yunohost.app/__NAME__/storage; @@ -79,19 +79,19 @@ location ~ ^/static/(webseed|redundancy|streaming-playlists)/ { limit_rate_after 5000k; if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; + more_set_headers "Access-Control-Allow-Origin : *"; + more_set_headers "Access-Control-Allow-Methods : GET, OPTIONS"; + more_set_headers "Access-Control-Allow-Headers : Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"; + more_set_headers "Access-Control-Max-Age : 1728000"; + more_set_headers "Content-Type : text/plain charset=UTF-8"; + more_set_headers "Content-Length : 0"; return 204; } if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + more_set_headers "Access-Control-Allow-Origin : *"; + more_set_headers "Access-Control-Allow-Methods : GET, OPTIONS"; + more_set_headers "Access-Control-Allow-Headers : Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"; # Don't spam access log file with byte range requests access_log off;