Example: WordPress

First, make sure WordPress is set up and running with php-fpm.

A minimal Caddyfile config is:

example.com {
	root * /var/www/wordpress
	encode gzip
	php_fastcgi unix//run/php/php-version-fpm.sock
	file_server
}

Be sure to tune this config for your setup:

  • Your domain name
  • Site root
  • The php-fpm socket or port

Be sure that WordPress is configured securely, including (but not limited to!) not allowing .php or other executable files to be uploaded by users.

9 Likes

A post was split to a new topic: How can I configure WordPress multisite?

For anyone who comes across this issue (like I did and took a while to find a solution): How should I setup permissions for Wordpress?

Follow Austin’s guide here which worked for me in getting started: Using Caddy for WordPress Local Development

1 Like