From c44ac064b6630189ea8fb02dba3f4690efff2dd5 Mon Sep 17 00:00:00 2001 From: Sugeng Sulistiyawan Date: Fri, 24 May 2024 16:28:26 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Update=20configuration=20to=20deny?= =?UTF-8?q?=20access=20to=20hidden=20files=20and=20directories,=20include?= =?UTF-8?q?=20.map=20&=20.mjs=20files=20to=20ignore=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2/Generic/Generic | 8 ++++++-- v2/Yii/Yii 2 | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/v2/Generic/Generic b/v2/Generic/Generic index b9a32e9..c10fb88 100644 --- a/v2/Generic/Generic +++ b/v2/Generic/Generic @@ -39,13 +39,17 @@ server { fastcgi_param PHP_VALUE "{{php_settings}}"; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + 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; } -} \ No newline at end of file +} diff --git a/v2/Yii/Yii 2 b/v2/Yii/Yii 2 index 16ef8bd..a1e7d87 100755 --- a/v2/Yii/Yii 2 +++ b/v2/Yii/Yii 2 @@ -1,4 +1,4 @@ -#{"rootDirectory":"web","phpVersion":"7.4"} +#{"rootDirectory":"web","phpVersion":"8.3"} server { listen 80; listen [::]:80; @@ -39,13 +39,17 @@ server { fastcgi_param PHP_VALUE "{{php_settings}}"; } - location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + 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; } -} \ No newline at end of file +}