Closed ayrat555 closed 3 years ago
how does NGINX behave if the underlying service isn't reachable? childchain has a route:
get "health.check" do
Health.call(conn, %{})
end
that works as: if everything is OK, return 200. if requests shouldn't be routed to this childchain, return 503.
can you make sure that:
health.check
and routes requests to it if it's healthy@InoMurko Initially, I was trying to use health_check
directive, but it turns out this directive is available only in the commercial version of nginx
.
what I did:
childchain
upstream which should contain a list of childchain
server https://github.com/omgnetwork/childchain/pull/159/files#diff-4a09c0a0fa902cb0f31dbe2d49b7e9455ad37b89f60dab3857fa7b2fe3d9481eR8When one server is not available, the next server will be chosen.
If all servers are not available, by default Nginx returns 502 or 504 errors. I changed it to 503
thats great!
we'll see now how pull_childchain_health
works with nginx in front
@InoMurko I fixed port conflicts in pull_childchain_health
should be merged after https://github.com/omgnetwork/specs/pull/20/files
fixes https://github.com/omgnetwork/childchain/issues/153