Multiple bind statements

Caddy is behind sslh on IPv4, but I now have dual-stack IPv6 at home. I was hoping to make Caddy bind to specific addresses for both v4 and v6 but the last bind statement appears to win - i.e. Caddy no longer listens on IPv4 if I have the v6 bind last

1. My Caddy version (caddy -version):

Caddy v1.0.3 (h1:i9gRhBgvc5ifchwWtSe7pDpsdS9+Q0Rw9oYQmYUTw1w=)

2. How I run Caddy: {
        bind #yes, this is to allow sslh to work
        bind #resolves to a specific v6 address
        root /var/www/sites/
        log / /var/log/caddy/ "{combined}"

        tls {
                dns gandiv5

a. System environment:

OS, relevant versions, systemd? docker? etc.
Ubuntu 19.04, systemd 240

This pull request may be of interest to you:

It looks like this would add multiple binds to Caddy 1.0 - however it doesn’t appear to be merged in.

@matt’s last comment also seems relevant if you were thinking about testing out Caddy 2 beta:

FYI, the equivalent capability (binding to multiple interfaces) is already working natively in Caddy 2, and the v2 Caddyfile supports multiple bind addresses, so this PR would only affect Caddy 1. It’s up to you whether to continue with this. :slight_smile: Thank you for working on it!

Thanks. It also seems like it wasn’t straightforward in the past: ipv6: does not bind on ipv4 and ipv6 for sites that resolve to both · Issue #864 · caddyserver/caddy · GitHub

Caddy 2 is looking promising. I may try running it on another VM to test it out.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.