Merge pull request #29 from sugeng-sulistiyawan/master

 Update configuration to deny access to hidden files and directories, include .map & .mjs files to ignore log for Yii 2 & Generic Template PHP
This commit is contained in:
cloudpanel-io
2024-05-24 13:34:51 +02:00
committed by GitHub
2 changed files with 13 additions and 5 deletions

View File

@@ -39,13 +39,17 @@ server {
fastcgi_param PHP_VALUE "{{php_settings}}"; 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 "*"; add_header Access-Control-Allow-Origin "*";
expires max; expires max;
access_log off; access_log off;
} }
location ~ /\.(ht|svn|git) {
deny all;
}
if (-f $request_filename) { if (-f $request_filename) {
break; break;
} }
} }

View File

@@ -1,4 +1,4 @@
#{"rootDirectory":"web","phpVersion":"7.4"} #{"rootDirectory":"web","phpVersion":"8.3"}
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
@@ -39,13 +39,17 @@ server {
fastcgi_param PHP_VALUE "{{php_settings}}"; 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 "*"; add_header Access-Control-Allow-Origin "*";
expires max; expires max;
access_log off; access_log off;
} }
location ~ /\.(ht|svn|git) {
deny all;
}
if (-f $request_filename) { if (-f $request_filename) {
break; break;
} }
} }