mirror of
https://github.com/getgrav/grav.git
synced 2026-05-05 15:37:32 +02:00
25 lines
752 B
Caddyfile
25 lines
752 B
Caddyfile
:8080
|
|
encode gzip
|
|
root * /path/to/grav/root
|
|
php_fastcgi unix//run/php/php7.3-fpm.sock
|
|
file_server
|
|
|
|
# Begin - Security
|
|
# deny all direct access for these folders
|
|
rewrite /(\.git|cache|bin|logs|backups|tests)/.* /403
|
|
|
|
# deny running scripts inside core system folders
|
|
rewrite /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ /403
|
|
|
|
# deny running scripts inside user folder
|
|
rewrite /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ /403
|
|
|
|
# deny access to specific files in the root folder
|
|
rewrite /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) /403
|
|
|
|
respond /403 403
|
|
## End - Security
|
|
|
|
# global rewrite should come last.
|
|
try_files {path} {path}/ /index.php?_url={uri}&{query}
|