Confused about networking settings / cant access app's port 80

Hi all.
I’m new to fly.io, and trying to deploy my app, but i’m very confused with the networking settings.

My app is being built via Dockerfile, and I have web services listening on ports 80, 81 and 443. The app deploys fine and I can see it running via the dashboard → monitoring. However, when I click on the link or visit the apps .fly.dev url, it is not reachable. I’ve tried modifying my fly.toml in different ways but i’m coming across outdated documentation posts and none of what I have tried seems to solve this for me.

I would appreciate a snippet for my fly.toml that would make my apps port 80, 81 and 443 available.

Thanks

I have an app that has a web server on port 80 and 443, and a separate service (in my case port 2222, but that shouldn’t matter). Here’s my fly.toml:

If you really want 80 and 443 to be handled separate, you can delete the [http_service] and repeat the [[services]] section, and you probably will need to add handlers for http for both, and tls for 443. See: Fly Launch configuration (fly.toml) · Fly Docs

One caution: you will end up needing a dedicated IPv4 address if you want to support access via IPv4. And if you don’t know the answer to this question, then you want a dedicated IPv4 address. Be aware that this is a priced feature.

I do not need to access it via IPv4, so it should be fine. I just need the app’s webui to come up when I visit myapp.fly.dev. This web ui runs on the app’s internal port 80.

In your case, is your app internally expecting connections on port 80 or 3000?

My app is expecting connections on port 3000. Feel free to adjust that as needed (including port 80).

I’m not having any luck with this…
Here is the modified snippet i’m using.

    [http_service]
      internal_port = 80
      force_https = true
      auto_stop_machines = false
      auto_start_machines = true
      min_machines_running = 0
    [[services]]
      internal_port = 81
      protocol = "tcp"
      [[services.ports]]
        port = 8081

The deploy command reports success, but visiting the link provided by the output shows nothing… just the browser message saying “We’re having trouble finding that site”.

I’m trying the url without any port specified and also trying the url:8081 … nothing.

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