1. Output of caddy version
:
v2.6.2
2. How I run Caddy:
a. System environment:
Ubuntu 20.04, Duck DDns with my router,Port forwarding to 4443, cause the ISP’s modem got port 80 and 443 blocked
b. Command:
sudo ~/go/caddy run --config /etc/caddy/Caddyfile
c. Service/unit/compose file:
d. My complete Caddy config:
****.duckdns.org:4443 {
tls {
dns duckdns {my token} {
override_domain ****.duckdns.org
}
root * /var/www/html/index.html
file_server
reverse_proxy /rss 127.0.0.1:181
encode zstd gzip
handle_errors {
rewrite * /{err.status_code}.html
}
}
3. The problem I’m having:
Hey Guys,
I’m new to Caddy, since nginx is just to complicated for me…
So I’m trying to build a homeserver with a RSS and a homeassistant on it.
Now I’m also stuggling to get Caddy to work.
No matter what I’ve changed, the browser always tells me “Connection Failure”,
except http://****.duckdns.org:4443, which gives this error"Client sent an HTTP request to an HTTPS server." (curl the same)
I have checked that port 4443 is open.
the tls was using DNS challenge to get from.
Could someone gimme a hand here?
Thnaks in advance!
4. Error messages and/or full log output:
H720@H720:/etc/caddy$ sudo ~/go/caddy start --config /etc/caddy/Caddyfile
2022/11/27 00:46:29.868 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
2022/11/27 00:46:29.870 WARN Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies {"adapter": "caddyfile", "file": "/etc/caddy/Caddyfile", "line": 11}
2022/11/27 00:46:29.871 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//[::1]:2019", "//127.0.0.1:2019", "//localhost:2019"]}
2022/11/27 00:46:29.872 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0006f6bd0"}
2022/11/27 00:46:29.872 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2022/11/27 00:46:29.872 INFO http enabling HTTP/3 listener {"addr": ":4443"}
2022/11/27 00:46:29.872 INFO tls cleaning storage unit {"description": "FileStorage:/root/.local/share/caddy"}
2022/11/27 00:46:29.873 INFO failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
2022/11/27 00:46:29.873 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2022/11/27 00:46:29.873 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2022/11/27 00:46:29.873 INFO http enabling automatic TLS certificate management {"domains": ["****.duckdns.org"]}
2022/11/27 00:46:29.873 INFO tls finished cleaning storage units
2022/11/27 00:46:29.874 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2022/11/27 00:46:29.874 INFO serving initial configuration
5. What I already tried:
curl ****.duckdns.org:4443 -v
* Trying ip.ip.ip.ip4443...
* Connected to ****.duckdns.org (ip.ip.ip.ip) port 4443 (#0)
> GET / HTTP/1.1
> Host: ****.duckdns.org:4443
> User-Agent: curl/7.83.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 400 Bad Request
<
Client sent an HTTP request to an HTTPS server.
* Closing connection 0