1. Caddy version (
2. How I run Caddy:
a. System environment:
caddy run -config Caddyfile
d. My complete Caddyfile or JSON config:
3. The problem I’m having:
I’m trying to run two sites through one server locally. I have added the http_port config in the global section, to deactivate SSL rereouting. I don’t know how to this for both sites.
4. Error messages and/or full log output:
"Client sent an HTTP request to an HTTPS server."
5. What I already tried:
I tried http_port 8080, 9999
6. Links to relevant resources:
I think you’ll want to use the
auto_https global option which is available in the latest v2.1 beta released a few days ago:
You can download it from here:
Well, this can’t be right. Can’t have two separate listeners on the same port (i.e. one for HTTP and one for HTTPS). (That is, unless you’re using something like Conncept: https://github.com/mholt/conncept.) It’ll definitely cause some problems if you keep it there and start trying to serve sites on default ports.
As @francislavoie stated, you can use the new global
auto_https option in v2.1 to disable Automatic HTTPS entirely, which will have everything served as HTTP.
Alternately, you can specify the scheme in your site label, e.g.
http://localhost:9999. Then you can ditch the global port options entirely.
When the scheme is ambiguous (i.e. unspecified), Caddy will assume a site on any port that isn’t the HTTP port is in fact a HTTPS site, if it can.
This topic was automatically closed after 30 days. New replies are no longer allowed.