-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caddyfile: Got error while trying to serve an http to https redirect aside the https virtual host. #3572
Comments
Well, it looks like you have a syntax error in that config. You have an extra When I try to adapt that Caddyfile I don't get that error. Please provide your full, unredacted Caddyfile so we can properly replicate the issue you're having. That said, I think 7bfe5b6 is a relevant fix, so you can try the latest by building from source, or you can use the latest CI artifacts. |
Hi, the full Caddyfile is presented below:
I've also verify that if I delete the HTTP virtual host (http://example.com), the caddy could works well. |
Have you tried with the latest build of Caddy as I asked above? Works for me. Closing because this has already been fixed on master. |
Hi, the caddy works well after using the latest CI artifacts. Thanks for your help! |
What did you do?
I started caddy2 with two virtual hosts with the same domain
example.com
.The first virtual host is
https://example.com
, which server an static site. The second virtual host ishttp://example.com
, which redirects the http traffic to the first virtual host.The CaddyFile looks like this:
What did you expect to see?
The caddy could redirect the Http traffic to the Https virtual host and server the virtual hosts normally.
What did you see instead?
caddy did not startup and failed with the following exception
adapting config using caddyfile: hostname appears in more than one automation policy, making certificate management ambiguous: example.com
Which is quite similar to the error got in #3351 and #3550
Caddy version
2.1.1
I indicates that this error was caused by something related to the certificate automation, however I've disabled auto_https at the beginning and use my own certificate. This issues hasn't been happened on caddy1 before.
Thanks.
The text was updated successfully, but these errors were encountered: