I’ve recently set up a v2 application, running Elixir + Phoenix, and had accidentally tried the first deploy with the default port at 8080, but the application is running at 4000.
I discovered this error, changed the fly.toml file, but now I just see the health checks failing, with the following message in the Health check ranges view;
Health check on port 8080 has failed. Your app is not responding properly.
Which in a sense, makes sense, as there is nothing happening at 8080.
But how do I change the 8080 of the health checks into port 4000, as the app is not running at 8080.
Beginner here, but I think it doesn’t make sense to define health checks to specific ports. You have the application running (on any internal port), and fly.io reverse proxies it to the standard HTTP port (which is 80).
I think you just have to make sure that the endpoint you want to use as healthcheck is accessible as https://<your-app-name>.fly.dev/<your-healthchek-endpoint> and “/your-healthcheck-endpoint” is what you must define in your fly.toml file.
My suggestion (it’s what I did to understand it): (1) delete all healthchecks from your toml; (2) implement an “/healthcheck” endpoint that returns 200 Ok; (3) test locally then deploy to see if you can access it in the browser (on the flyio servers); (4) add healthchecks again; (5) make it work!
Yeah, I understand. But I have the feeling that this is a bug in Fly. I can’t update the ports of the health checks, making rolling deploys impossible.