From e2e15fb429996f538c490f1f97a90fd90de8b0ba Mon Sep 17 00:00:00 2001 From: Stefan Wieczorek Date: Fri, 24 May 2024 13:37:36 +0200 Subject: [PATCH] . --- v2-http3/Generic/Generic | 6 +++++- v2-http3/Yii/Yii 2 | 9 ++++++--- v2-varnish/Generic/Generic | 6 +++++- v2-varnish/Yii/Yii 2 | 8 ++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/v2-http3/Generic/Generic b/v2-http3/Generic/Generic index 83bbe23..789f5e7 100644 --- a/v2-http3/Generic/Generic +++ b/v2-http3/Generic/Generic @@ -45,13 +45,17 @@ server { proxy_temp_file_write_size 256k; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ { add_header Access-Control-Allow-Origin "*"; add_header alt-svc 'h3=":443"; ma=86400'; expires max; access_log off; } + location ~ /\.(ht|svn|git) { + deny all; + } + if (-f $request_filename) { break; } diff --git a/v2-http3/Yii/Yii 2 b/v2-http3/Yii/Yii 2 index f1d411f..728b567 100755 --- a/v2-http3/Yii/Yii 2 +++ b/v2-http3/Yii/Yii 2 @@ -1,4 +1,4 @@ -#{"rootDirectory":"web","phpVersion":"7.4","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} +#{"rootDirectory":"web","phpVersion":"8.3","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} server { listen 80; listen [::]:80; @@ -45,13 +45,16 @@ server { proxy_temp_file_write_size 256k; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ { add_header Access-Control-Allow-Origin "*"; - add_header alt-svc 'h3=":443"; ma=86400'; expires max; access_log off; } + location ~ /\.(ht|svn|git) { + deny all; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Generic/Generic b/v2-varnish/Generic/Generic index 68e7d1d..b625834 100644 --- a/v2-varnish/Generic/Generic +++ b/v2-varnish/Generic/Generic @@ -41,12 +41,16 @@ server { proxy_temp_file_write_size 256k; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ { add_header Access-Control-Allow-Origin "*"; expires max; access_log off; } + location ~ /\.(ht|svn|git) { + deny all; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Yii/Yii 2 b/v2-varnish/Yii/Yii 2 index f89c9fb..6a3bcf5 100755 --- a/v2-varnish/Yii/Yii 2 +++ b/v2-varnish/Yii/Yii 2 @@ -1,4 +1,4 @@ -#{"rootDirectory":"web","phpVersion":"7.4","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} +#{"rootDirectory":"web","phpVersion":"8.3","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} server { listen 80; listen [::]:80; @@ -41,12 +41,16 @@ server { proxy_temp_file_write_size 256k; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ { + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ { add_header Access-Control-Allow-Origin "*"; expires max; access_log off; } + location ~ /\.(ht|svn|git) { + deny all; + } + if (-f $request_filename) { break; }