Skip to content

Commit a2530f4

Browse files
committed
Update default.conf.sample to deny dotfile access
Signed-off-by: Eric Nemchik <[email protected]>
1 parent c93252e commit a2530f4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ init_diagram: |
114114
"cops:latest" <- Base Images
115115
# changelog
116116
changelogs:
117+
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
117118
- {date: "08.02.26:", desc: "Adding missing php-tokenizer package."}
118119
- {date: "10.10.25:", desc: "Adding missing icu-data-full package."}
119120
- {date: "10.07.25:", desc: "Rebase to Alpine 3.22."}

root/defaults/nginx/site-confs/default.conf.sample

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Version 2025/07/10 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample
1+
## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-cops/commits/master/root/defaults/nginx/site-confs/default.conf.sample
22

33
server {
44
listen 80 default_server;
@@ -48,8 +48,16 @@ server {
4848
include /etc/nginx/fastcgi_params;
4949
}
5050

51-
# deny access to .htaccess/.htpasswd files
52-
location ~ /\.ht {
51+
# deny access to all dotfiles
52+
location ~ /\. {
5353
deny all;
54+
log_not_found off;
55+
access_log off;
56+
return 404;
57+
}
58+
59+
# Allow access to the ".well-known" directory
60+
location ^~ /.well-known {
61+
allow all;
5462
}
5563
}

0 commit comments

Comments
 (0)