Caddy not working at all for any reverse proxy after recent updates

1. The problem I’m having:

Caddy doesn’t work after latest update - no reverse proxies are resolved.

2. Error messages and/or full log output:

Error: sending configuration to instance: performing request: Post "http://localhost:2019/load": dial tcp 127.0.0.1:2019: connect: connection refused

(when trying to reload caddy file)

3. Caddy version:

v2.7.6

4. How I installed and ran Caddy:

via bash/apt

a. System environment:

Ubuntu 22.04.4 LTS x86-64

b. Command:

sudo caddy reload --config /etc/caddy/Caddyfile

d. My complete Caddy config:

# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
{
	debug
}
https://www.olliemon.co.uk {
	# Set this path to your site's directory.
	root * /usr/share/caddy

	# Enable the static file server.
	file_server
	# Another common task is to set up a reverse proxy:
	# reverse_proxy localhost:8080
	# Or serve a PHP site through php-fpm:
	# php_fastcgi localhost:9000#
	route /ombi* {
		reverse_proxy 127.0.0.1:5000
	}
}

map.olliemon.co.uk {
	reverse_proxy 127.0.0.1:8123
}

plex.olliemon.co.uk {
	reverse_proxy 127.0.0.1:32400
}

webmin.olliemon.co.uk {
	reverse_proxy 127.0.0.1:10000
}

amp.olliemon.co.uk {
	reverse_proxy 127.0.0.1:8080
}

bluemap.olliemon.co.uk {
	reverse_proxy 127.0.0.1:8100
}

home.olliemon.co.uk {
	reverse_proxy 192.168.0.195:8123
}

print.olliemon.co.uk {
	reverse_proxy 192.168.0.71 {
		header_up X-Scheme {scheme}
	}
}

obico.olliemon.co.uk {
	reverse_proxy 127.0.0.1:3334 {
		header_up X-Scheme {scheme}
	}
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

Please follow these instructions for using Caddy when you’ve installed it with apt:

Caddy is probably not running, so you can’t reload. It probably failed to start with an error. Check the logs for the error.

1 Like

When I try and restart/reload with systemctl, I get the error as follows:

Error loading initial config: loading new config

We need to see your full logs. Not just part of one line.

Follow the instructions at the link above, it shows you the command to use to see your full logs.

I’ve worked it out in the meantime - Caddy was unable to bind to any of the HTTP or HTTPS ports because NGINX had taken them. This is despite me uninstalling and purging NGINX prior to this. I can only assume that it is a dependency for another package I have installed.

Is there any way of forcing caddy to “load” first in the order of systemctl services to prevent this happening again if NGINX sneaks back otno the system?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.