Map multiple external ports to different internal ones

My app provides http/s on 80/443 and does SSL termination itself based on Letsencrypt. I further need another port (SSL-terminated with custom certificate) for GRPC, say 10000.

When I deploy my app I see

TCP 80/443/10000 ⇢ 80

which is obviously wrong. So what I would like to do is set internal_port per service instead of globally.

Is there a way to do that? It’s the final missing piece to migrate my applications from


1 Like

Yes this will actually work just fine! You can have multiple services, each with an internal_port and one-or-more port entries. Your services config might look like this:

internal_port = 8080
protocol = "tcp"

    handlers = ["http"]
    port = "80"

    handlers = ["tls", "http"]
    port = "443"

internal_port = 10000
protocol = "tcp"

    handlers = ["tls"]
    port = "10000"

The indents aren’t necessary, but helpful to show what’s happening.

1 Like

Oh yeah:

TCP 80 ⇢ 80
TCP 443 ⇢ 443
TCP 10000 ⇢ 10000

Great, much appreciated!