One domain multiple ports

Hi!

Is it possible to have vhosts on the same domain with different ports. Something like this:

example.com:9180 {
        proxy / 127.0.0.1:9180 {
                transparent
        }
}

example.com:9090 {
        proxy / 127.0.0.1:9090 {
                transparent
        }
}

example.com:9100 {
        proxy / 127.0.0.1:9100 {
                transparent
        }
}

I would be also OK without HTTP > HTTPS redirection.

Yes, that’s quite doable. The port is part of the vhost / site, so those are technically three different sites, and Caddy will happily serve all of them.

I believe with that configuration Caddy will try to requisition a certificate and serve those sites over HTTPS on the ports you specified. Disabling Automatic HTTPS can be done with tls off, which would serve those sites over HTTP on the specified ports, or by explicitly specifying the scheme http:// in your site addresses.

Thank you, it works. I am not sure why it did not work when I first tried.