Skip to content

Commit 716b123

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

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ init_diagram: |
219219
"swag:latest" <- Base Images
220220
# changelog
221221
changelogs:
222+
- {date: "08.02.26:", desc: "[Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) site-confs/default.conf - Deny access to all dotfiles."}
222223
- {date: "23.01.26:", desc: "Reorder init to fix proxy conf version checks."}
223224
- {date: "21.12.25:", desc: "Add support for hetzner-cloud dns validation."}
224225
- {date: "04.11.25:", desc: "Switch default Gandi credentials from API Key to Token, allow DNS propagation time for Azure DNS plugin."}

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

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

33
# redirect all traffic to https
44
server {
@@ -13,9 +13,9 @@ server {
1313
# main server block
1414
server {
1515
listen 443 ssl default_server;
16-
# listen 443 quic reuseport default_server;
1716
listen [::]:443 ssl default_server;
18-
# listen [::]:443 quic reuseport default_server;
17+
#listen 443 quic reuseport default_server;
18+
#listen [::]:443 quic reuseport default_server;
1919

2020
server_name _;
2121

@@ -74,9 +74,17 @@ server {
7474
include /etc/nginx/fastcgi_params;
7575
}
7676

77-
# deny access to .htaccess/.htpasswd files
78-
location ~ /\.ht {
77+
# deny access to all dotfiles
78+
location ~ /\. {
7979
deny all;
80+
log_not_found off;
81+
access_log off;
82+
return 404;
83+
}
84+
85+
# Allow access to the ".well-known" directory
86+
location ^~ /.well-known {
87+
allow all;
8088
}
8189
}
8290

0 commit comments

Comments
 (0)