Skip to content

Commit

Permalink
Update Caddyfile
Browse files Browse the repository at this point in the history
Mitigate spam
  • Loading branch information
basilhendroff committed Sep 18, 2021
1 parent a4c0c16 commit 83085ba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions includes/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
order error before respond # Only required for Caddy 2.4.1 quarterly release. Remove for Caddy 2.4.5 quarterly release.
# debug
log {
format json {
Expand Down Expand Up @@ -36,4 +37,14 @@
path /wp-content/debug.log
}
respond @forbidden 403

# Mitigate spam attack logins and comments
@protected path_regexp (wp-comments-posts|wp-login)\.php$
handle @protected {
@no-referer {
not header Referer https://{host}*
method POST
}
abort @no-referer
}
}

0 comments on commit 83085ba

Please sign in to comment.