vix health
vix health checks whether a Vix application is reachable and healthy.
Use it when you want to verify local endpoints, public HTTPS endpoints, or WebSocket endpoints in production.
vix healthOverview
vix health is the production health-check command for Vix.
It can check:
- local application endpoint
- public HTTPS endpoint
- WebSocket endpoint
- expected HTTP status
- response time
- configured systemd service state
- production health config from
vix.json
It is useful after:
- starting a service
- restarting a service
- deploying a new version
- changing Nginx proxy config
- enabling TLS
- debugging production availability
Usage
vix health [command]Commands
| Command | Purpose |
|---|---|
vix health | Check all configured health endpoints. |
vix health local | Check the local application endpoint. |
vix health public | Check the public endpoint. |
vix health websocket | Check the WebSocket endpoint. |
vix health ws | Alias for websocket. |
Basic examples
# Check all configured endpoints
vix health
# Check local app health
vix health local
# Check public HTTPS health
vix health public
# Check WebSocket health
vix health websocket
# Same as websocket
vix health wsConfiguration source
vix health reads health configuration from:
vix.jsonunder:
production.healthExample:
{
"name": "PulseGrid",
"production": {
"health": {
"service": "pulsegrid.service",
"local": "http://127.0.0.1:8080/",
"public": "https://pulsegrid.example.com/",
"websocket": "wss://pulsegrid.example.com/ws",
"expected_status": 200,
"timeout_ms": 3000,
"max_response_ms": 1000
}
}
}Health config fields
| Field | Purpose |
|---|---|
production.health.service | Optional systemd service name to check before local/all health checks. |
production.health.local | Local HTTP endpoint. |
production.health.public | Public HTTP or HTTPS endpoint. |
production.health.websocket | WebSocket endpoint. |
production.health.expected_status | Expected HTTP status for local and public checks. Default: 200. |
production.health.timeout_ms | Request timeout in milliseconds. |
production.health.max_response_ms | Maximum allowed response time in milliseconds. |
Local health
Local health checks the application directly on the server.
Example config:
{
"production": {
"health": {
"service": "pulsegrid.service",
"local": "http://127.0.0.1:8080/"
}
}
}Run:
vix health localExpected output shape:
Health Check
Target: local
URL: http://127.0.0.1:8080/
Expected: 200
Status: 200
Time: 12 ms
Max time: 1000 ms
Healthy: yes
local endpoint is healthyUse local health to verify that the app itself is alive before debugging Nginx, TLS, DNS, or the public URL.
Public health
Public health checks the endpoint exposed through your domain.
Example config:
{
"production": {
"health": {
"public": "https://pulsegrid.example.com/"
}
}
}Run:
vix health publicExpected output shape:
Health Check
Target: public
URL: https://pulsegrid.example.com/
Expected: 200
Status: 200
Time: 80 ms
Max time: 1000 ms
Healthy: yes
public endpoint is healthyUse public health after configuring:
vix proxy nginx init
vix proxy nginx certbot
vix proxy nginx checkWebSocket health
WebSocket health checks the configured WebSocket endpoint.
Example config:
{
"production": {
"health": {
"websocket": "wss://pulsegrid.example.com/ws"
}
}
}Run:
vix health websocketor:
vix health wsThe WebSocket check sends a WebSocket upgrade request.
It expects:
101because a successful WebSocket handshake normally returns HTTP 101 Switching Protocols.
WebSocket URL conversion
For the underlying request, Vix converts WebSocket URLs to HTTP-style URLs:
ws:// -> http://
wss:// -> https://Examples:
ws://127.0.0.1:9090/ws
-> http://127.0.0.1:9090/ws
wss://pulsegrid.example.com/ws
-> https://pulsegrid.example.com/wsThen Vix sends upgrade headers such as:
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Key: ...
Sec-WebSocket-Version: 13Check all endpoints
Run:
vix healthThis prints the configured health summary, then checks every enabled endpoint.
Example config summary:
Health Config
App: PulseGrid
Service: pulsegrid.service
Local: http://127.0.0.1:8080/
Public: https://pulsegrid.example.com/
WebSocket: wss://pulsegrid.example.com/wsIf no health endpoint is configured, Vix fails with a fix:
no health endpoints configured
Fix: add production.health to vix.jsonService check
If production.health.service is configured, Vix checks whether the service is active before local or all checks.
Example:
{
"production": {
"health": {
"service": "pulsegrid.service",
"local": "http://127.0.0.1:8080/"
}
}
}If the service is not running:
configured service is not running
Fix: run `vix service status`This avoids misleading health checks when the app process is not active.
Expected status
For local and public health checks, the default expected status is:
200You can override it:
{
"production": {
"health": {
"local": "http://127.0.0.1:8080/health",
"expected_status": 204
}
}
}For WebSocket checks, the expected status is:
101The WebSocket expected status is fixed by the WebSocket check behavior.
Timeout
Use timeout_ms to control request timeout.
Example:
{
"production": {
"health": {
"local": "http://127.0.0.1:8080/",
"timeout_ms": 3000
}
}
}If the endpoint does not respond before the timeout, the check fails.
Maximum response time
Use max_response_ms to enforce a performance threshold.
Example:
{
"production": {
"health": {
"public": "https://pulsegrid.example.com/",
"max_response_ms": 1000
}
}
}If the response takes longer than the configured max time, Vix reports:
response time exceededHealth result output
Every health check prints:
| Field | Meaning |
|---|---|
Target | local, public, or websocket. |
URL | Endpoint being checked. |
Expected | Expected status code. |
Status | Actual status or connection failed. |
Time | Response time in milliseconds. |
Max time | Maximum allowed response time. |
Healthy | yes or no. |
Error | Error message when unhealthy. |
Exit codes
vix health returns:
| Exit code | Meaning |
|---|---|
0 | Health check passed. |
1 | Health check failed, endpoint missing, service not running, or unknown command. |
This makes it useful in scripts and deployment pipelines.
Full production health example
{
"name": "PulseGrid",
"production": {
"health": {
"service": "pulsegrid.service",
"local": "http://127.0.0.1:8080/",
"public": "https://pulsegrid.example.com/",
"websocket": "wss://pulsegrid.example.com/ws",
"expected_status": 200,
"timeout_ms": 3000,
"max_response_ms": 1000
}
}
}Then run:
vix healthor check each endpoint separately:
vix health local
vix health public
vix health websocketRelationship with vix service
vix service manages the application process.
vix health checks whether the application responds.
A normal production check is:
vix service status
vix health localAfter restart:
vix service restart
vix health localRelationship with vix proxy nginx
vix proxy nginx manages Nginx.
vix health public checks the public endpoint after Nginx and TLS are configured.
A normal proxy check is:
vix proxy nginx check
vix health publicFor WebSocket apps:
vix proxy nginx check
vix health websocketRelationship with vix doctor production
vix doctor production inspects the full production state.
vix health focuses only on endpoint health.
Use both:
vix health
vix doctor productionvix doctor production can use health readiness as part of a broader production readiness picture.
Relationship with vix deploy
A deployment flow can run health checks after restarting the service.
Example:
vix deploy
vix health
vix doctor productionIf health fails, inspect:
vix service status
vix service logs
vix proxy nginx check
vix logsRecommended production workflow
After installing the service:
vix service start
vix health localAfter setting up the proxy:
vix proxy nginx check
vix health publicAfter setting up WebSocket proxying:
vix proxy nginx check
vix health websocketAfter deployment:
vix service restart
vix health
vix doctor productionCommands reference
| Command | Description |
|---|---|
vix health | Check all configured endpoints. |
vix health local | Check the local endpoint. |
vix health public | Check the public endpoint. |
vix health websocket | Check the WebSocket endpoint. |
vix health ws | Alias for WebSocket health. |
vix health --help | Show help. |
Common workflows
Check local app only
vix health localCheck public app only
vix health publicCheck WebSocket endpoint
vix health wsCheck everything configured
vix healthCheck after service restart
vix service restart
vix health localCheck after proxy setup
vix proxy nginx check
vix health publicCheck after TLS setup
vix proxy nginx certbot
vix proxy nginx check
vix health publicCheck after deployment
vix deploy
vix health
vix doctor productionCommon mistakes
Running health without configuration
Wrong:
vix healthwithout production.health.
Correct:
{
"production": {
"health": {
"local": "http://127.0.0.1:8080/"
}
}
}Then run:
vix health localExpecting local health to test Nginx
Local health checks the app directly.
For Nginx/public URL, use:
vix health publicExpecting public health to debug the app process
Public health goes through DNS, TLS, Nginx, and the app.
If public health fails, check the lower layers:
vix service status
vix health local
vix proxy nginx checkExpecting WebSocket health to return 200
WebSocket health expects:
101because a successful WebSocket handshake switches protocols.
Forgetting the service check
If you configure:
{
"production": {
"health": {
"service": "pulsegrid.service"
}
}
}and the service is stopped, Vix fails before the local/all health check.
Start or inspect the service:
vix service status
vix service startSetting max_response_ms too low
If your endpoint is healthy but slower than the threshold, Vix reports:
response time exceededIncrease the threshold or optimize the endpoint.
Troubleshooting
No health endpoints configured
Add production.health to vix.json.
Example:
{
"production": {
"health": {
"local": "http://127.0.0.1:8080/"
}
}
}Configured service is not running
Run:
vix service statusStart or restart:
vix service start
vix service restartLocal health fails
Check that the app is running:
vix service statusCheck logs:
vix service logsCheck that the app listens on the configured port:
ss -tulpnPublic health fails
Check Nginx:
vix proxy nginx checkCheck local health:
vix health localCheck service logs:
vix service logsCommon causes:
- service stopped
- wrong public domain
- DNS not pointing to the server
- Nginx config invalid
- wrong upstream port
- TLS certificate missing or invalid
- firewall blocks ports
80or443
WebSocket health fails
Check proxy configuration:
vix proxy nginx checkCheck that the app listens on the configured WebSocket port.
Check the WebSocket health URL:
{
"production": {
"health": {
"websocket": "wss://pulsegrid.example.com/ws"
}
}
}Common causes:
- wrong WebSocket path
- wrong WebSocket port
- missing Nginx upgrade headers
- app WebSocket server not running
- TLS or proxy issue
Unexpected HTTP status
If Vix reports:
unexpected HTTP statusthe endpoint responded, but not with the expected status.
Check the route and expected status.
Example:
{
"production": {
"health": {
"local": "http://127.0.0.1:8080/health",
"expected_status": 204
}
}
}Connection failed
If status is:
connection failedthe endpoint could not be reached.
Check:
vix service status
vix service logs
vix proxy nginx checkBest practices
Keep health configuration in vix.json.
Always define a local health endpoint for backend apps.
Define a public health endpoint when the app is exposed through a domain.
Define WebSocket health only when the app exposes WebSocket.
Use /health or / as a lightweight endpoint.
Keep health endpoints fast.
Use max_response_ms to catch slow deployments.
Run vix health after every deployment.
Run vix doctor production after health checks.
Use vix service logs or vix logs when health fails.
Related commands
| Command | Purpose |
|---|---|
vix service | Manage the systemd app service. |
vix proxy nginx | Manage Nginx reverse proxy configuration. |
vix doctor production | Inspect complete production readiness. |
vix logs | Inspect production logs. |
vix deploy | Deploy a production app. |
vix build | Build the app binary. |
vix run | Run the app manually. |
Next step
Inspect production readiness.