Nginx Proxy Guard

Features

Notifications

NPG sends events that affect operation (failed certificate renewals, failed nginx reloads, IP bans, low disk space and others) and a daily summary to external channels. There are three channel types, Discord, Telegram and Webhook; the webhook reaches receivers such as ntfy, Gotify, Apprise and Home Assistant.

Notifications are designed to stay quiet. An ongoing failure is announced when it starts and when it recovers, not in between, and bursts such as IP bans are coalesced into one message per five minutes.

Where it is

Settings → Notifications, in the Operations group of the settings tabs. It is shown to roles with the Settings permission area.

Settings → Notifications with one webhook channel
Settings → Notifications with one webhook channel

Adding a channel

  1. Click Settings → Notifications → Add channel.
  2. Enter a Name, choose the Type and fill in the connection details for that type (table below).
  3. Under What to send, choose Off, Immediate or Summary only for each alert.
  4. To receive a daily summary, turn on Send a daily summary and set the hour.
  5. Save, then click Send test on the channel and check that the message arrives.
TypeFieldsWhat to prepare
DiscordDiscord webhook URLIn the Discord channel: Edit Channel → Integrations → Webhooks → New Webhook, then Copy Webhook URL. The URL itself is the credential.
TelegramBot token, Chat IDSend /newbot to @BotFather to get a bot token. A bot cannot message you first: send your bot a message, add it to a group and post there, or add it as a channel admin and post once. Then click Detect chat id and pick the conversation.
Webhook (any URL)Receiver URL, Authorization header (only if needed), Body formatCreate a receiving address on your receiver. For receivers whose URL carries the topic, like ntfy, choose Plain text (ntfy); for Gotify, Apprise, Home Assistant and your own receivers choose JSON.

An example webhook for ntfy:

FieldValue
Receiver URLhttps://ntfy.example.com/npg-alerts
Authorization headerBearer tk_example_token (only if the server requires it)
Body formatPlain text (ntfy)

Common settings

FieldDescription
Use this channelOff sends nothing to this channel.
Send a daily summary, Send atSends a summary once a day. The hour is in the server's time zone, which follows TZ in the Docker Compose file.
Message languageThe language of alerts on this channel (Korean, English), independent of the panel language.
Use the platform's own formattingDiscord gets an embed, Telegram MarkdownV2. For webhooks it only affects the human-readable text line.
Dashboard addressA link appended to the daily summary. Use the admin panel address the people reading this channel actually use.
Message format (optional)Empty uses the default format. The placeholders below are available.

Placeholders for the message format:

{{event}} {{time}} {{host}} {{ip}} {{country}} {{reason}} {{count}} {{detail}}
{{instance}} {{subject}} {{free}} {{growth_per_day}} {{days_to_full}} {{roles}} {{action}}

Request headers, cookies, the User-Agent, the request URL and raw log data are not available as placeholders, because they can carry credentials.

Available alerts

AlertSent when
Certificate renewal failedA Let's Encrypt renewal failed
Certificate renewedOnly when a renewal that had been failing works again
DDNS update failedThe public IP changed but DNS was not updated
DDNS updating againOnly when a failing DDNS record works again
Scheduled backup failedThe scheduled backup ran and failed
nginx reload failedApplying the configuration failed through every retry. nginx keeps running the previous configuration.
Admin sign-in locked outFailed sign-ins reached the lockout. Coalesced per five minutes.
IP bannedfail2ban or WAF auto-ban blocked an address. Coalesced per five minutes.
IP detected (not banned)A fail2ban rule set to Notify Only reached its threshold. Coalesced per five minutes.
SSO sign-in refusedAn identity outside the allowlist tried to sign in through SSO
Disk space running lowA disk NPG writes to passed the warning line (85% by default); sent once
Disk space criticalIt passed the critical line (90% by default). On the database disk, older log chunks are compressed right away to win space back.
Disk space back to normalOnly when a disk that was low drops below the recovery line (80% by default)
Domain entry needs reviewA domain in an access list changed in a way that needs confirmation, such as a new CNAME target
Domain entry change not appliednginx did not accept a change of domain entries

The disk warning, critical and recovery lines can be changed with environment variables; see the disk entries in Environment variables.

Testing and delivery log

  • Send test sends a test message to check the connection.
  • Send now on an alert and Preview the summary (send now) send a real message right away. They use the saved settings, so save first to see your changes.
  • Delivery log shows each channel's delivery results and attempts.
  • When deliveries fail in a row, the channel shows the count of failures, and at 10 the channel turns itself off.

Limits

  • The channel types are Discord, Telegram and Webhook. There is no email channel.
  • NPG does not send ordinary requests or individual access log lines as notifications.