Let's Encrypt Not Working for me in V2

For next time, it’s easier to follow and comment on your Caddyfile if you put it in the forums. You can use ``` on lines before and after your config to give it code formatting.

As a side note, you can use the caddy fmt command to clean up the indentation of your Caddyfile, it’ll make it much easier to read. Actually, I’ll do that for you right now:

################################################################################################
# Global Options Block																		   #
################################################################################################
#{
#	acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
#	tls user@domain.net        # Email for Let's Encrypt Verification
#}
################################################################################################
# Airsonic Admin subdomain code block example 			   https://github.com/airsonic/airsonic#
################################################################################################
https://jukebox.domain.net/ http://local.airsonic/ {
	encode gzip
	log {
		output file /logs/airsonic.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:4040 {
		header_up Host {http.reverse_proxy.upstream.hostport}
	}
}
##############################################################################################
# Calibre subdomain code block example 							   https://calibre-ebook.com/#
##############################################################################################
library1.domain.net http://local.calibre {
	encode gzip
	log {
		output file /logs/calibre.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:7070
}
##############################################################################################
# Calibre-gui subdomain code block example	    https://github.com/JiriS97/docker-calibre-gui#
##############################################################################################
library-gui.domain.net http://local.calibre-gui {
	encode gzip
	log {
		output file /logs/calibre-gui.log
		format single_field common_log
	}
	#basicauth {
	#	domain JDJhJDEwJEUzN0NxUFBzbnA4dEZHQUh0TmpHV3VnZVgzSlZtVXU1TU9lMkR1dWJWNEdmUlFQTU92cHJD
	#}
	reverse_proxy 192.168.1.103:5800
}
##############################################################################################
# Calibre-web subdomain code block example			  https://github.com/janeczku/calibre-web#
##############################################################################################
library2.domain.net http://local.calibre-web {
	encode gzip
	log {
		output file /logs/calibre-web.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8083
}
##############################################################################################
# Deluge Admin subdomain code block example						   http://deluge-torrent.org/#
##############################################################################################
flood.domain.net http://local.deluge {
	encode gzip
	log {
		output file /logs/deluge.log
		format single_field common_log
	}
	reverse_proxy http://192.168.1.103:8112
}
##############################################################################################
# FireDaemon Fusion subdomain code block example											 #
##############################################################################################
services.domain.net http://local.fusion {
	encode gzip
	log {
		output file /logs/fusion.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:20604
}
##############################################################################################
# Grafana subdomain code block example						    	   	 https://grafana.com/#
##############################################################################################
performance.domain.net http://local.performance {
	encode gzip
	log {
		output file /logs/grafana.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:3000
}
##############################################################################################
# InfluxDB subdomain code block example														 #
##############################################################################################
metrics.domain.net {
	encode gzip
	log {
		output file /logs/influxdb.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8086
}
##############################################################################################
# Jackett subdomain code block example					   https://github.com/Jackett/Jackett#
##############################################################################################
tsearches.domain.net http://local.jackett {
	encode gzip
	log {
		output file /logs/jackett.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:9117
}
##############################################################################################
# LazyLibrarian subdomain code block example		https://github.com/DobyTang/LazyLibrarian#
##############################################################################################
books.domain.net http://local.lazylibrarian {
	encode gzip
	log {
		output file /logs/lazylibrarian.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:5299 {
		header_up Host {http.reverse_proxy.upstream.hostport}
	}
}
##############################################################################################
# Lidarr subdomain code block example							https://https://lidarr.audio/#
##############################################################################################
music2.domain.net http://local.lidarr {
	encode gzip
	log {
		output file /logs/lidarr.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8686
}
##############################################################################################
# Logarr subdomain code block example					   https://github.com/Monitorr/logarr#
##############################################################################################
logs.domain.net http://local.logarr {
	encode gzip
	log {
		output file /logs/logarr.log
		format single_field common_log
	}
	basicauth {
		domain JDJhJDEwJEUzN0NxUFBzbnA4dEZHQUh0TmpHV3VnZVgzSlZtVXU1TU9lMkR1dWJWNEdmUlFQTU92cHJD
	}
	reverse_proxy 192.168.1.103:8081
}
##############################################################################################
# Monitorr subdomain code block example					https://github.com/Monitorr/Monitorr/#
##############################################################################################
monitor.domain.net http://local.monitorr {
	encode gzip
	log {
		output file /logs/monitorr.log
		format single_field common_log
	}
	basicauth {
		domain JDJhJDEwJEUzN0NxUFBzbnA4dEZHQUh0TmpHV3VnZVgzSlZtVXU1TU9lMkR1dWJWNEdmUlFQTU92cHJD
	}
	reverse_proxy 192.168.1.103:8084
}
##############################################################################################
# Nzbhydra2 subdomain code block example			   https://github.com/theotherp/nzbhydra2#
##############################################################################################
asearches.domain.net http://local.nzbhydra2 {
	encode gzip
	log {
		output file /logs/nybhydra2.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:5076
}
##############################################################################################
# Ombi subdomain code block example							 https://github.com/tidusjar/Ombi#
##############################################################################################
requests.domain.net http://local.ombi {
	encode gzip
	log {
		output file /logs/ombi.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:3579
}
##############################################################################################
# Organizr subdomain code block example					  https://github.com/causefx/Organizr#
##############################################################################################
portal.domain.net http://local.organizr {
	encode gzip
	log {
		output file /logs/organizr.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8082
}
##############################################################################################
# Plex subdomain code block																	 #
##############################################################################################
htpc.domain.net http://local.plex {
	encode gzip
	log {
		output file /logs/plex.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:32400
}
##############################################################################################
# Portainer subdomain code block example			   https://github.com/portainer/portainer#
##############################################################################################
dockdash.domain.net http://local.portainer {
	encode gzip
	log {
		output file /logs/portainer.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:9000
}
##############################################################################################
# Radarr subdomain code block example						 https://github.com/Radarr/Radarr#
##############################################################################################
movies.domain.net http://local.radarr {
	encode gzip
	log {
		output file /logs/radarr.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:7878
}
##############################################################################################
# Sabnzbd subdomain code block example									 https://sabnzbd.org/#
##############################################################################################
downloads.domain.net http://local.sabnzbd {
	encode gzip
	log {
		output file /logs/sabnzdb.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8080
}
##############################################################################################
# Sonarr subdomain code block example									   https://sonarr.tv/#
##############################################################################################
tv.domain.net http://local.sonarr {
	encode gzip
	log {
		output file /logs/sonarr.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8989
}
##############################################################################################
# Tautulli Admin subdomain code block example			 https://github.com/Tautulli/Tautulli#
##############################################################################################
htpcstats.domain.net http://local.tautulli {
	encode gzip
	log {
		output file /logs/tautulli.log
		format single_field common_log
	}
	reverse_proxy 192.168.1.103:8181
}

So now for some feedback:

https://jukebox.domain.net/ http://local.airsonic/ {

You’ll need to remove the trailing / here, this’ll make only requests to the root of that site match. Caddy v2’s path matching is exact match, meaning that you would need a * at the end of those to match all paths… or just omit the / altogether.

The rest of your Caddyfile looks good! :+1:

Now looking at the logs…

2020/05/17 12:45:31 [ERROR] error: one or more domains had a problem:
[movies.domain.net] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Invalid response from http://movies.domain.net/.well-known/acme-challenge/gKaKQf1UYHeLuV7gzBLUY1Pt3ILs-GNGGGTcm5K8hTw [71.91.198.200]: "<html>\r\n    <head><title>Document Error: Not Found</title></head>\r\n    <body>\r\n        <h2>Access Error: Not Found</h2>\r\n       ", url:
 (challenge=http-01 remaining=[tls-alpn-01])

This is the error that’s causing certificate issuance to fail. Essentially this is saying that Let’s Encrypt tried to make a request to get the ACME challenge from your domain, but instead it got a 404 from whatever server it was able to contact.

Do you have another serving on those domains already? Is your DNS pointing to an old server? You’ll need to make sure the routing is correct.