3 ms·
Is this safe for WordPress though? Every time I look at switching from nginx to Caddy where I have WordPress hosted, I get into the weeds trying to figure out i
by aorth 1y ago
Is this safe for WordPress though? Every time I look at switching from nginx to Caddy where I have WordPress hosted, I get into the weeds trying to figure out if I need to block certain paths in `wp-includes` and `wp-admin` etc.
For example, from a discussion on the Caddy forum https://caddy.community/t/using-caddy-to-harden-wordpress/13575 https://caddy.community/t/using-caddy-to-harden-wordpress/13...:
(harden-wordpress) {
@harden-wordpress expression `(
!{path}.matches("/wp-includes/ms-files.php$")
&& ({path}.matches("(?i)/wp-includes/.*\\.php")
|| {path}.matches("(?i)/wp-admin/includes/.*\\.php")
|| {path}.matches("(?i)/wp-content/uploads/.*\\.php")
)
)`
respond @harden-wordpress "Access denied" 403
}