Caddyfile-0.8.x 831 B

123456789101112131415161718192021222324252627282930313233
  1. # Caddyfile for Caddy 0.8.x and below
  2. :8080
  3. gzip
  4. fastcgi / 127.0.0.1:9000 php
  5. # Begin - Security
  6. # deny all direct access for these folders
  7. rewrite {
  8. r /(\.git|cache|bin|logs|backups|tests)/.*$
  9. status 403
  10. }
  11. # deny running scripts inside core system folders
  12. rewrite {
  13. r /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$
  14. status 403
  15. }
  16. # deny running scripts inside user folder
  17. rewrite {
  18. r /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$
  19. status 403
  20. }
  21. # deny access to specific files in the root folder
  22. rewrite {
  23. r /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess)
  24. status 403
  25. }
  26. ## End - Security
  27. # global rewrite should come last.
  28. rewrite {
  29. to {path} {path}/ /index.php?_url={uri}&{query}
  30. }