Mercurial > prosody-modules
view mod_http_health/README.md @ 5951:d6a695abb33c
mod_ping_muc: Delay ping a configurable amount of time
If a server is restarting, checking immediately before it has a chance
to complete its restart and get ready would often fail, preventing the
possibility of transparent restarts as supported by Prosody's mod_muc.
Reconnecting immediately when a connection is closed for being idle, or
because the remote server is trying to reclaim some resources, is also
counter-productive as the connection may fail.
Also, if there is some Internet routing problem affecting s2s, it may
help to wait a bit before checking, in case the problem resolved itself
in the mean time.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 11 Aug 2024 16:10:24 +0200 |
parents | 09233b625cb9 |
children |
line wrap: on
line source
Simple module adding an endpoint meant to be used for health checks. # Configuration After installing, enable by adding to [`modules_enabled`][doc:modules_enabled] like many other modules: ``` lua -- in the global section modules_enabled = { -- Other globally enabled modules here... "http_health"; -- add } ``` ## Access control By default only access via localhost is allowed. This can be adjusted with `http_health_allow_ips`. The following example shows the default: ``` http_health_allow_ips = { "::1"; "127.0.0.1" } ``` Access can also be granted to one IP range via CIDR notation: ``` http_health_allow_cidr = "172.17.2.0/24" ``` The default for `http_health_allow_cidr` is empty. # Details Adds a `http://your.prosody.example:5280/health` endpoint that returns either HTTP status code 200 when all appears to be good or 500 when any module [status][doc:developers:moduleapi#logging-and-status] has been set to `error`. # See also - [mod_measure_modules] provides module statues via OpenMetrics - [mod_http_status] provides all module status details as JSON via HTTP