Skip to content

Instantly share code, notes, and snippets.

@gchacaltana
Created September 12, 2023 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gchacaltana/9e3e1dbd402705fde6fcca5f56975a6f to your computer and use it in GitHub Desktop.
Save gchacaltana/9e3e1dbd402705fde6fcca5f56975a6f to your computer and use it in GitHub Desktop.
Add denny access directive email
# Deny all attempts to access hidden files/folders such as .git, .htaccess, .htpasswd, .DS_Store (Mac), etc...
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Deny yaml, twig, markdown, ini file access
location ~* /.+\.(markdown|md|twig|yaml|yml|ini)$ {
deny all;
access_log off;
log_not_found off;
}
# Deny all grunt, package files
location ~* (Gruntfile|package)\.(js|json|jsonc)$ {
deny all;
access_log off;
log_not_found off;
}
# Deny all composer files
location ~* composer\. {
deny all;
access_log off;
log_not_found off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment