Direct private-data request
- Example
curl -I https://sameos.uk/data/targets.txt- Result
HTTP 404
The response does not disclose whether the underlying file exists.
Block private folders under the public root and serve files only through an authenticated router.
A starter deny rule for separating public pages from private file folders.
# Direct file access block
location ~ ^/(private_uploads|logs|data)/ {
return 404;
}
# Authenticated media router
location = /media.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
This example requests the default data folder on the current domain and compares it with a normal public page.
curl -I https://sameos.uk/data/targets.txtHTTP 404The response does not disclose whether the underlying file exists.
curl -I https://sameos.uk/HTTP 200The control confirms that blocking is scoped to the designated private path rather than the whole site.