Update configuration to deny access to hidden files and directories, include .map & .mjs files to ignore log

This commit is contained in:
Sugeng Sulistiyawan
2024-05-24 16:28:26 +07:00
parent f2441df12b
commit c44ac064b6
2 changed files with 13 additions and 5 deletions

View File

@@ -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;
}
}
}