WordPress 404 file not find error when running on caddy2 service

Here is common caddy file.

www.xxx.com {
	root * /var/www/html/www.xxx.com
	encode gzip
	log {
		level DEBUG
		output file /var/log/caddy/xxx.com.log {
		   roll_size 10MiB
		   roll_keep 10
	@disallowed {
			path /xmlrpc.php
			path *.sql
			path /wp-content/uploads/*.php

	rewrite @disallowed '/index.php'

In addition to the correct configuration file, you also need to set the user permissions, because caddy is run by caddy and php-fpm is run by www-data. Permission issues are preventing access to the file.

Add caddy to the www-data group.

sudo usermod -aG www-data caddy

Was this helpful?

0 / 0

发表回复 0