restrictions.conf.hbs 746 B

1234567891011121314151617181920212223242526
  1. # Global restrictions configuration file.
  2. # Designed to be included in any server {} block.
  3. location = /favicon.ico {
  4. log_not_found off;
  5. access_log off;
  6. }
  7. location = /robots.txt {
  8. allow all;
  9. log_not_found off;
  10. access_log off;
  11. }
  12. # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  13. # Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
  14. location ~ /\. {
  15. deny all;
  16. return 404;
  17. }
  18. # Deny access to any files with a .php extension in the uploads directory
  19. # Works in sub-directory installs and also in multisite network
  20. # Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
  21. location ~* /(?:uploads)/.*\.php$ {
  22. deny all;
  23. }