I’m currently running though the process of converting Caddyfile v1 to v2…
This obvervation caused me some pain…
Could you clarify if the following error is expected when using a combination of http
and https
site addresses?
To me it seems wrong, I shouldn’t need to duplicate complex site configurations for both secure and non-secure right?
1. Caddy version (caddy version
):
v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
2. How I run Caddy:
a. System environment:
Windows 10
b. Command:
caddy.exe adapt --config C:\projects\server1\etc\caddy\CaddyfileV2 --adapter caddyfile --pretty
d. My complete Caddyfile:
example.com,
http://www.example.com {
tls support@example.com
reverse_proxy http://example.net
}
4. Error messages and/or full log output:
adapt: server listening on [:80] is HTTP, but attempts to configure TLS connection policies
5. What I already tried:
Tried using the global email
, which outputs successfully (without error):
{
email support@example.net
}
example.com,
http://www.example.com {
reverse_proxy http://example.net
}
But what about the case where I don’t want to define a global email for all sites in the Caddyfile?
Also is there really a problem with the following Caddyfile similar to the following?
(global_good_stuff) {
tls support@example.com
# some other defaults here, complex redirections, blocking bad actors etc.
}
example.com,
http://www.example.com {
import global_good_stuff
reverse_proxy http://example.net
}
http://subsite1.example.com {
import global_good_stuff
}
http://subsite2.example.com {
import global_good_stuff
}
This didn’t cause an error in Caddy V1.
Cheers!