Skip to content

Commit b0c11a3

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

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ init_diagram: |
173173
"mastodon:latest" <- Base Images
174174
# changelog
175175
changelogs:
176+
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
176177
- {date: "21.10.25:", desc: "Add prometheus exporter support."}
177178
- {date: "20.10.25:", desc: "Add vips-heif."}
178179
- {date: "08.07.25:", desc: "Rebase to Alpine 3.22."}

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Version 2024/08/26 - Changelog: https://github.com/linuxserver/docker-mastodon/commits/main/root/defaults/nginx/site-confs/default.conf.sample
1+
## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-mastodon/commits/main/root/defaults/nginx/site-confs/default.conf.sample
22

33
map $http_upgrade $connection_upgrade {
44
default upgrade;
5-
'' close;
5+
'' close;
66
}
77

88
upstream backend {
@@ -20,6 +20,8 @@ server {
2020
listen [::]:80 default_server;
2121
listen 443 ssl default_server;
2222
listen [::]:443 ssl default_server;
23+
listen 443 quic reuseport default_server;
24+
listen [::]:443 quic reuseport default_server;
2325

2426
server_name _;
2527

@@ -141,9 +143,16 @@ server {
141143

142144
error_page 404 500 501 502 503 504 /500.html;
143145

144-
# deny access to .htaccess/.htpasswd files
145-
location ~ /\.ht {
146+
# deny access to all dotfiles
147+
location ~ /\. {
146148
deny all;
149+
log_not_found off;
150+
access_log off;
151+
return 404;
147152
}
148153

154+
# Allow access to the ".well-known" directory
155+
location ^~ /.well-known {
156+
allow all;
157+
}
149158
}

0 commit comments

Comments
 (0)