about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-10-14 21:10:00 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-10-14 21:10:00 +0300
commit114a1028748fd550df314213816c001af419eb2c (patch)
tree03a491c5c09c4150a6aa759506c31a93194efe69
parent680836cd0983d13eebd4209416e4747c5ba17b58 (diff)
downloadthe-epube-114a1028748fd550df314213816c001af419eb2c.tar.gz
the-epube-114a1028748fd550df314213816c001af419eb2c.tar.xz
forbid nginx access to dotfiles
-rw-r--r--.docker/web-nginx/nginx.conf9
1 files changed, 9 insertions, 0 deletions
diff --git a/.docker/web-nginx/nginx.conf b/.docker/web-nginx/nginx.conf
index 1115616..e688a42 100644
--- a/.docker/web-nginx/nginx.conf
+++ b/.docker/web-nginx/nginx.conf
@@ -24,6 +24,15 @@ http {
 		listen [::]:8080;
 		root ${APP_WEB_ROOT};
 
+		# Deny direct access to dotfiles/underscore-prefixed path segments: git metadata, .env,
+		# editor/build junk (.phpstan-tmp/, .phpunit.result.cache, __pycache__ etc.). The dev
+		# compose override bind-mounts the whole project directory into this container, so those
+		# files are otherwise servable (and .phpstan-tmp/*.php would even be passed to php-fpm);
+		# unanchored on purpose, ${APP_BASE} may be "" (site root) or "/tt-rss".
+		location ~ "/[._]" {
+			deny all;
+		}
+
 		location ${APP_BASE}/db {
 			internal;
 		}