Dual-stack Linux box with multiple IPv4 and IPv6 addresses (among which are 172.16.0.26 and 172.16.0.27) using Caddy 0.9.0.
Starting out simple, I created the following Caddyfile:
www.friendsr.us {
bind 172.16.0.27
proxy / http://127.0.0.1:2368 {
transparent
}
tls admin@friendsr.us
}
The expectation is that Caddy will bind to 172.16.0.27:80 and 172.16.0.27:443, which is the target of the following network chain:
Router → port forward WAN 80 to 172.16.0.26:80 → sslh forward to 172.16.0.27:80
Router → port forward WAN 443 to 172.16.0.26:443 → sslh forward to 172.16.0.27:443
Naturally, sslh (on the same box) is already listening on 80 and 443 (on 172.16.0.26).
No matter what I put in the “bind” directive, however, Caddy seems to insist on a box-wide binding:
[pid 30387] bind(4, {sa_family=AF_INET6, sin6_port=htons(443), inet_pton(AF_INET6, “::”, &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use)
[pid 30387] close(4) = 0
[pid 30387] write(2, “2016/08/15 12:36:42 [www.friends”…, 1992016/08/15 12:36:42 [www.friendsr.us] failed to get certificate: [www.friendsr.us] error presenting token: Could not start HTTPS server for challenge → listen tcp :443: bind: address already in use
) = 199
How can I get Caddy to respect this bind request?
Thanks,
Rodney