ข้อความโดย: อั๋น ทรงวุฒิ
« เมื่อ: 21 มีนาคม 2021, 03:38:31 PM »Nginx
log access to drop file in /etc/nginx/ but don't log 404
location = /robots.txt {
access_log drop;
log_not_found off;
}
log access to drop file in /etc/nginx/ but don't log 404
location = /favicon.ico {
access_log drop;
log_not_found off;
}
เหมาะกับ Laravel
log access to denied file in /etc/nginx/ but don't log 404 and also deny all to dot files
location ~ /\. {
access_log denied;
log_not_found off;
deny all;
}
log access to drop file in /etc/nginx/ but don't log 404 and also deny all to files starting with a dollar sign ($temp.config.php)
location ~ ~$ {
access_log denied;
log_not_found off;
deny all;
}
Apache
เหมาะกับ Laravel
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
log access to drop file in /etc/nginx/ but don't log 404
location = /robots.txt {
access_log drop;
log_not_found off;
}
log access to drop file in /etc/nginx/ but don't log 404
location = /favicon.ico {
access_log drop;
log_not_found off;
}
เหมาะกับ Laravel
log access to denied file in /etc/nginx/ but don't log 404 and also deny all to dot files
location ~ /\. {
access_log denied;
log_not_found off;
deny all;
}
log access to drop file in /etc/nginx/ but don't log 404 and also deny all to files starting with a dollar sign ($temp.config.php)
location ~ ~$ {
access_log denied;
log_not_found off;
deny all;
}
Apache
เหมาะกับ Laravel
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>