Skip to content

Commit 1f4892f

Browse files
committed
Update default.conf.sample to deny dotfile access
Signed-off-by: Eric Nemchik <eric@nemchik.com>
1 parent eed6cae commit 1f4892f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ init_diagram: |
144144
"nextcloud:develop" <- Base Images
145145
# changelog
146146
changelogs:
147+
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
147148
- {date: "10.07.25:", desc: "Rebase to Alpine 3.22."}
148149
- {date: "12.02.25:", desc: "Rebase to Alpine 3.21."}
149150
- {date: "09.01.25:", desc: "Fix uploading large files. Existing users should update their nginx confs."}

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-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample
1+
## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample
22

33
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
44
map $arg_v $asset_immutable {
@@ -165,8 +165,16 @@ server {
165165
try_files $uri $uri/ /index.php$request_uri;
166166
}
167167

168-
# deny access to .htaccess/.htpasswd files
169-
location ~ /\.ht {
168+
# deny access to all dotfiles
169+
location ~ /\. {
170170
deny all;
171+
log_not_found off;
172+
access_log off;
173+
return 404;
174+
}
175+
176+
# Allow access to the ".well-known" directory
177+
location ^~ /.well-known {
178+
allow all;
171179
}
172180
}

0 commit comments

Comments
 (0)