Bash
public
Nginx Config Test
Share this script safely, inspect its metadata, and copy the exact command you need.
Ready to run
One-liner
curl -fsSL https://runny.sh/r/QP7AYXA1NZG7 | bash
Current version: 1.1 · Updated by Godmode · 2026-09-07 02:38:59.285
At a glance
Script metadata
Readable before runnable
Preview
#!/usr/bin/env bash
# Nginx config test
# Read-only: runs nginx -t. Does not reload or write configuration.
# Exit 0 if the config is valid, 1 if nginx is missing, 2 if nginx -t fails.
# Hosted on Runny.sh. Review the script page before you run it.
set -u
status=0
note() { printf '%s\n' "$*"; }
note "=== Nginx configuration test ==="
if ! command -v nginx >/dev/null 2>&1; then
note "nginx: not found in PATH"
note "Result: WARNING"
exit 1
fi
note "Binary: $(command -v nginx)"
note "Version: $(nginx -v 2>&1 || true)"
note ""
if out=$(nginx -t 2>&1); then
printf '%s\n' "$out"
note ""
note " OK"
note "Result: HEALTHY"
exit 0
else
printf '%s\n' "$out"
note ""
note " CRITICAL: nginx -t rejected the configuration"
note "Result: CRITICAL"
exit 2
fi
Raw endpointhttps://runny.sh/r/QP7AYXA1NZG7
See something unsafe?
Report this script
Tell us why it should come down. Anyone can also report a URL at /abuse.