9 Hidden Paths Bots Sweep on Your Domain in 3 Sec (And How to Block Them Without Breaking Next.js)

Within minutes of pointing DNS at a production server, automated scanners begin probing nine specific paths on your domain:
/.env, /.git/config, /.git/HEAD, /.DS_Store, /backup.zip, /backup.sql, /db.sql, /wp-config.php.bak, and /phpinfo.php.
If your deployment pipeline drops any of these into the public root—common during fast VPS deploys, freelance handoffs, or vibe-coded weekend launches—any anonymous GET request dumps your database credentials, cloud keys, or full git history with a CVSS 9.8 impact.
Why naive status-code checks fail
If you curl /.env against a Next.js or SPA frontend and see 200 OK, you might panic over a false positive because your router served index.html. Real exposure testing checks response signatures: key-value env assignments, [core] git headers, ref: refs/heads/, Bud1 macOS headers, PK\x03\x04 zip headers, or SQL schema definitions.
Lock it down at the edge or reverse proxy
Nginx:
nginx
location ~* /(.|backup.(zip|sql)|db.sql|wp-config.php.bak|phpinfo.php) {
deny all;
return 404;
}
Apache (.htaccess):
apache
Require all denied
Cloudflare WAF Custom Rule (Action: Block):
text
(http.request.uri.path contains "/.env") or (http.request.uri.path contains "/.git") or (http.request.uri.path contains "/.DS_Store") or (ends_with(http.request.uri.path, ".sql")) or (ends_with(http.request.uri.path, ".bak")) or (ends_with(http.request.uri.path, ".zip")) or (http.request.uri.path contains "phpinfo.php")
Also ensure .git and .env* are listed inside .dockerignore so they never end up inside production container layers.
I built a lightweight, signature-verified external probe that tests all 9 paths alongside 20+ TLS, header and DNS controls in about 3 sec if you want to sanity-check your live domain: https://www.snippipedia.com/tools/secure-scan