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:
$curl localhost:8080
site1%
$curl localhost:9999
"Client sent an HTTP request to an HTTPS server."
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:8080, 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.