Wildcard on multiples IP address

Hi guys, I have two different apps that have thousands of domains each. I want use caddy server to listen for any host on two different IP address (one for each app) and proxy to my apps.

I using a Caddyfile like this:

:80 :443 {
  bind yyy.yyy.yyy.yyy

  proxy / localhost:4000 {
    websocket
    policy ip_hash
    transparent
  }

  tls sample@mail.com
  tls {
    max_certs 5000
  }
}

:80 :443 {
  bind xxx.xxx.xxx.xxx

  proxy / localhost:3000 {
    websocket
    policy ip_hash
    transparent
  }

  tls sample@mail.com
  tls {
    max_certs 5000
  }
}

But I get next error message: duplicate site address: :80

Exist a way to wildcard hosts to different IP address on Caddyfile?

If you take out the bind directives and remove the duplicate site definition, Caddy should accept connections on all interfaces. Does that help?

No, because I want listen some domains on a IP, and the others on a second IP. Example:

domain1, domain2, ... domain1000     -> IP1
domain1001, domain1002,...domain2000 -> IP2

And then proxy domains from IP1 to internal1 and domains from IP2 to a different sever

So, you could just specify the domains in your Caddyfile, since duplicate sites aren’t allowed; I know of some companies that have thousands of domains per block. That’ll work just fine.

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