Skip to content

Commit 60c2ad4

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

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

readme-vars.yml

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

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Version 2024/05/27 - Changelog: https://github.com/linuxserver/docker-mastodon/commits/glitch/root/defaults/nginx/site-confs/default.conf.sample
1+
## Version 2026/02/08 - Changelog: https://github.com/linuxserver/docker-mastodon/commits/glitch/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 {
@@ -16,8 +16,12 @@ upstream streaming {
1616
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=1g;
1717

1818
server {
19-
listen *:80 default_server;
20-
listen *:443 ssl default_server;
19+
listen 80 default_server;
20+
listen [::]:80 default_server;
21+
listen 443 ssl default_server;
22+
listen [::]:443 ssl default_server;
23+
listen 443 quic reuseport default_server;
24+
listen [::]:443 quic reuseport default_server;
2125

2226
server_name _;
2327

@@ -139,9 +143,16 @@ server {
139143

140144
error_page 404 500 501 502 503 504 /500.html;
141145

142-
# deny access to .htaccess/.htpasswd files
143-
location ~ /\.ht {
146+
# deny access to all dotfiles
147+
location ~ /\. {
144148
deny all;
149+
log_not_found off;
150+
access_log off;
151+
return 404;
145152
}
146153

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

0 commit comments

Comments
 (0)