-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Caddyfile for newer Caddy versions #1115
- Loading branch information
1 parent
c3aa11a
commit af53d79
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Caddyfile for Caddy 0.8.x and below | ||
|
||
:8080 | ||
gzip | ||
fastcgi / 127.0.0.1:9000 php | ||
|
||
# Begin - Security | ||
# deny all direct access for these folders | ||
rewrite { | ||
r /(.git|cache|bin|logs|backups|tests)/.*$ | ||
status 403 | ||
} | ||
# deny running scripts inside core system folders | ||
rewrite { | ||
r /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ | ||
status 403 | ||
} | ||
# deny running scripts inside user folder | ||
rewrite { | ||
r /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ | ||
status 403 | ||
} | ||
# deny access to specific files in the root folder | ||
rewrite { | ||
r /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) | ||
status 403 | ||
} | ||
## End - Security | ||
|
||
# global rewrite should come last. | ||
rewrite { | ||
to {path} {path}/ /index.php?_url={uri} | ||
} |