Skip to content

Commit 277d121

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

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
@@ -172,6 +172,7 @@ init_diagram: |
172172
"mastodon:develop" <- Base Images
173173
# changelog
174174
changelogs:
175+
- {date: "08.02.26:", desc: "Existing users should update: site-confs/default.conf - Deny access to all dotfiles."}
175176
- {date: "21.10.25:", desc: "Add prometheus exporter support."}
176177
- {date: "20.10.25:", desc: "Add vips-heif."}
177178
- {date: "06.06.25:", desc: "Rebase to Alpine 3.22, replace deprecated imagemagick with vips."}

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