Hey,
I have an application deployed successfully.
I am trying to add a new http health check.
I added services.http_checks
at the end of the fly.toml file.
Here is the whole toml file:
app = "black-forest-5489"
kill_signal = "SIGTERM"
kill_timeout = 5
processes = []
[build]
dockerfile = "Dockerfile.deployment"
[build.args]
MIX_ENV = "staging"
[deploy]
release_command = "/app/bin/migrate"
[env]
MIX_ENV = "staging"
PHX_HOST = "black-forest-5489.fly.dev"
PORT = "8080"
[experimental]
auto_rollback = true
[[services]]
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls","http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[services.http_checks]]
grace_period = "20s"
interval = "5m"
method = "get"
path = "/healthz"
protocol = "http"
restart_limit = 0
timeout = "5s"
tls_skip_verify = true
I see these when I do flyctl checks list
If I have the protocol as http, the check fails with this:
HTTP GET http://172.19.70.218:8080/healthz: 301 Moved Permanently Output: [✓]
In the logs for this I can see this:
[info] Plug.SSL is redirecting GET /healthz to https://black-forest-5489.fly.dev with status 301
I also tried https:
Get "https://172.19.70.218:8080/healthz": http: server gave HTTP response to HTTPS client[✓]
If I call the endpoint from the browser etc, I get a 200 response.
Does anybody know how to resolve this issue?