"unexpectedly closed the connection" yet app services is healthy?

I have the following fastify app which is reporting back as healthy:

However, when I utilise flyctl open or navigate to either the hostname or IP address, I am seeing a " vega.fly.dev unexpectedly closed the connection." message on https?

My Dockerfile is as follows:

# FROM latest node image https://hub.docker.com/_/node/
FROM node:latest

# Create and set app directory
RUN mkdir -p /usr/src/

WORKDIR /usr/src/app/

# Prefer not to run as root.
USER node

# Give ownership to the node user:
USER root

RUN chown -R node /usr/src/app/

RUN corepack enable

USER node

COPY --chown=node ./ /usr/src/app/

RUN yarn install

# Build for production
RUN yarn build

# Expose internal port for production

# Server for production
ENTRYPOINT [ "yarn" ]
CMD ["serve"]

And my fly.toml is as follows:

# fly.toml file generated for vega on 2022-06-13T16:52:46+01:00

app = "vega"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

  PORT = "8080"

  allowed_public_ports = []
  auto_rollback = true

  http_checks = []
  internal_port = 8981
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
    hard_limit = 25
    soft_limit = 20
    type = "connections"

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

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

    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

What extra do I need to do here to get this working?

Nothing stands out as being wrong in those …

In my experience with Node/Fastify you need to be listening on IPv6, rather than IPv4. That isn’t the default. So for example a mini Fastify app (notice the listen line at the bottom):

'use strict'

import Fastify from 'fastify'

const fastify = Fastify({
    logger: true

fastify.get('/', async (request, reply) => {
    return { hello: 'world' }

const start = async () => {
    try {
        fastify.log.info('Starting web server ...');
        await fastify.listen(8080, '::')
    } catch (err) {

That listen line listens on :: Give that a try. May be as simple as changing that equivalent in your js code.