mirror of
https://github.com/cloudpanel-io/vhost-templates.git
synced 2026-05-18 08:23:31 +08:00
✨ Update configuration to deny access to hidden files and directories, include .map & .mjs files to ignore log
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
v2/Yii/Yii 2
10
v2/Yii/Yii 2
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user