Created
September 12, 2023 03:40
-
-
Save gchacaltana/9e3e1dbd402705fde6fcca5f56975a6f to your computer and use it in GitHub Desktop.
Add denny access directive email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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