-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Caddy panics when binding systemd socket to http/s server #6833
Comments
Hmm! I am not very well versed with the systemd sockets, but @MayCXC may have a clue on this one. |
@chovanecadam if you need a quick workaround, see if after some digging, it looks like quic-go/quic-go#3727 is relevant, and the update in |
I compiled from source with Here's my Caddyfile. The rest of the configuration (all systemd sockets, etc.) are the same.
Caddy responds with status code 200 and Content-Length 0 to any request to http or https. The expected behavior is that caddy responds with "hello world". If I replace If I remove HTTP/1.1 308 Permanent Redirect
Connection: close
Location: https://example.com:0/
Server: Caddy
Date: Fri, 14 Feb 2025 14:56:54 GMT
Content-Length: 0 It does not make a difference if I specify only one |
@MayCXC A proper workaround is to specify Writing this just to clear things up that
|
I know this might not be exactly what you are looking for but I got my setup working like this:
Seems to for me, I was also looking for how to get around repeating the bind section, I hope it helps :) |
@MartinSchmidt that does not work for me. Accessing Here's my working config:
|
@chovanecadam weird with the redirect to port 0, works fine here :/ $ curl -vv http://example.com
* Host example.com:80 was resolved.
* IPv6: (none)
* IPv4: 192.168.12.95
* Trying 192.168.12.95:80...
* Connected to example.com (192.168.12.95) port 80
> GET / HTTP/1.1
> Host: example.com
> User-Agent: curl/8.9.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 308 Permanent Redirect
< Connection: close
< Location: https://example.com/
< Server: Caddy
< Date: Sun, 16 Feb 2025 18:08:27 GMT
< Content-Length: 0
<
* shutting down connection #0 But I am glad that the hint helped :) |
Description
SystemD creates file descriptors
fd/3
(80/tcp),fd/4
(443/tcp), andfd/5
(443/udp) and passes them to Caddy. The following Caddyfile is functional and works as expected, that is Caddy listens on port 80 for HTTP/1.1, on port 443/tcp for HTTP/1.1 and HTTP/2.0, and on port 443/udp for HTTP3.0.However, this forces me to repeat the
bind
directive for every server individually, which is not ideal. I expected the following Caddyfile to work, that is I expected that thebind
directives in catch-allhttp://
block will be applied to all other blocks, thus not needing to repeat the directive over and over again. However, this results in Caddy exiting with a panic.caddy.socket:
caddy.container:
log
The text was updated successfully, but these errors were encountered: