roles/caddy/templates: closer to supporting WordPress

I still wouldn't want to deploy WordPress on Caddy until it's more
obvious and standard to block paths that shouldn't be accessible.
It seems that this is still left as an exercise to the site admin.

This discussion has some tips, but it is four years old and hasn't
changed since I last looked.

See: https://caddy.community/t/using-caddy-to-harden-wordpress/13575
This commit is contained in:
Alan Orth 2025-03-29 22:09:37 +03:00
parent 5aa6a33e51
commit 22c16e1ed3
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -33,7 +33,14 @@
encode zstd gzip
file_server
{% endif %}
{% elif has_wordpress -%}
root * {{ document_root }}
encode
{% if ansible_distribution == 'Debian' and ansible_distribution_major_version is version('12', '==') -%}
php_fastcgi unix//run/php/php8.2-fpm-{{ domain_name }}.sock
{% endif -%}
file_server
{% endif -%}
import security-headers
}