| 12345678910111213141516171819202122232425262728293031 | # To use this file simply install caddy and run the command below from the root of your Grav site# Once running it will redirect http://localhost to https://localhost (new default for Caddy2)# More infromation here: https://caddyserver.com/docs/## $ caddy run --config webserver-configs/Caddyfilelocalhostencode gziproot * .file_serverphp_fastcgi 127.0.0.1:9000# Begin - Security# deny all direct access for these foldersrewrite /(\.git|cache|bin|logs|backups|tests)/.* /403# deny running scripts inside core system foldersrewrite /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ /403# deny running scripts inside user folderrewrite /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ /403# deny access to specific files in the root folderrewrite /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) /403respond /403 403## End - Security# global rewrite should come last.try_files {path} {path}/ /index.php?_url={uri}&{query}
 |