diff --git a/etc/nginx/common/locations.conf b/etc/nginx/common/locations.conf index d580c145..441b4ea8 100644 --- a/etc/nginx/common/locations.conf +++ b/etc/nginx/common/locations.conf @@ -69,20 +69,21 @@ location ~ ^/(status|ping) { # Security Settings For Better Privacy +# Deny Hidden Files location ~ /\. { deny all; access_log off; log_not_found off; } +# Deny To .log Extension location ~* ^.+\.log$ { deny all; access_log off; log_not_found off; } -location ~ /readme\.(txt|html)$ { - deny all; - access_log off; - log_not_found off; +# Return 403 Forbidden For readme.(txt|html) or license.(txt|html) +if ($request_uri ~* "^.+(readme|license)\.(txt|html)$") { + return 403; }