Nginx Proxy Guard

A reverse proxy that shows every request and stops the ones that shouldn't get through

A reverse proxy for nginx that you manage from a web UI. You set up proxy hosts, SSL certificates, the WAF (ModSecurity) and access controls per domain; Nginx Proxy Guard writes the nginx config, checks it with nginx -t and applies it. If the check fails, the previous config stays in place.

Latest v2.72.9 (2026-11-26) · Docker Compose · amd64, arm64 · MIT License

Access logSample
  • 403photos.example.comExploit
  • 200cloud.example.comNot Blocked
  • 403git.example.netWAF 942100
  • 403home.example.comGeo Block
  • 200photos.example.comNot Blocked
  • 403status.example.comBot Filter
  • 302cloud.example.comCloud
  • 200game.example.comStream

What changes compared with plain nginx

NPG still runs nginx underneath. It takes over the parts you would otherwise do by hand and adds the security features nginx doesn't come with.

Config changes
nginx on its ownYou edit config files by hand. One typo can make the reload fail, and a change applied without checking can take every site down.
With NPGA change in the web UI is written to a config file, checked with nginx -t and then applied. If the check fails, the previous config stays in place.
Certificates
nginx on its owncertbot, a renewal cron job and DNS challenge plugins have to be set up and kept working together.
With NPGNPG issues and renews Let's Encrypt certificates. DNS challenges such as Cloudflare or Route 53, and wildcard certificates, are picked in the web UI.
WAF
nginx on its ownModSecurity has to be built together with nginx and the CRS rules added. Avoiding false positives means editing rule files yourself.
With NPGModSecurity v3 and the OWASP CRS are already built in and switched on per host. A rule that misfires is turned off right from the log view.
Country and bot blocking
nginx on its ownYou look after the GeoIP module, its database updates and User-Agent lists yourself.
With NPGA MaxMind key is all it takes for country allow and block lists; blocking data-center ranges and a challenge page (reCAPTCHA, hCaptcha, Turnstile) are switched on in the web UI too. Bot lists and public blocklist subscriptions are included.
Repeated attacks
nginx on its ownfail2ban is a separate install, with regular expressions written to match your log format.
With NPGfail2ban and the WAF auto-ban read NPG's own logs and ban the IP. Your LAN and trusted IPs can be left out.
Logs
nginx on its ownFinding out who was blocked by what means grepping log files.
With NPGEvery request is stored compressed in a database and can be searched by host, IP and status code, down to the block reason and rule. TCP/UDP streams are logged too.
Many sites
nginx on its ownAs sites are added, the same security settings get copied into each file and kept in sync by hand.
With NPGSet global defaults once and every host follows them; only the hosts that need something different are changed.
Several admins
nginx on its ownThe only option is handing out access to the server.
With NPGRole-based permissions, two-factor authentication, SSO sign-in and an audit log of admin actions.

How a request reaches your service

A request only goes through the stages its host has turned on. The stage that stopped it shows in the logs as the block reason.

  1. Request

    Internet

    Browsers, apps, bots

  2. 1

    Country, IP, bot

    Country and cloud ranges, banned IPs, bot filter, exploit and URI rules

  3. 2

    WAF

    ModSecurity, OWASP CRS

  4. 3

    Rate limit

    Requests per second per IP

  5. 4

    Access list

    Allowed IPs and domains, usernames and passwords

  6. 5

    Challenge

    Hosts that set country or cloud blocking to challenge

  7. Passed

    Your service

    Containers, internal servers

The Nginx Proxy Guard dashboard
The dashboard: requests, blocks and response times over the last 24 hours, and the server's resources.

Features

Security features can be turned on per host, or set once as a global default that every host follows.

Proxy hosts

Connects a domain to a service on your network. Docker containers can be picked from a list, and HTTP/2, HTTP/3, WebSocket, load balancing across several backends and TCP/UDP streams are supported.

Proxy host docs
The proxy host list: domain, forward address, enabled features and status on each line

Blocked requests come with a reason

Every log line shows which stage and rule stopped the request. If it was a false positive, the log detail lets you turn that rule off for the whole host, one path or one parameter.

Reading logs and block reasons
The access log, with block reasons such as Exploit, URI Block and Bot Filter next to the status codes

Access lists with usernames and passwords

Allow or deny by IP, range or domain name. Add accounts to a list and visitors are asked for a username and password; with Satisfy Any on, the allowed IPs get in without one.

Access list docs
The access list editor with allow and deny rules and a username

SSL certificates

Issues Let's Encrypt certificates with the HTTP or DNS challenge and by default renews them 30 days before they expire. The DNS challenge also gets you wildcard certificates, and the key can be RSA or ECDSA. Certificates you already have can be uploaded.

SSL certificate docs
The SSL certificate list: domains, issue status, expiry date and linked hosts

More features

  • WAFDocs

    Inspects requests with ModSecurity (v3.0.15) and the OWASP CRS (v4.26.0). Each host runs in blocking or detection mode.

  • Country and cloud blocking, bot filterDocs

    Allows or blocks by country, blocks cloud provider IP ranges or shows them a challenge page, and filters known bots by User-Agent.

  • Automatic bansDocs

    fail2ban and the WAF auto-ban block IPs that keep causing trouble, for as long as you set. Public blocklists can be subscribed to as well.

  • Users and rolesDocs

    Several admins with role-based permissions, two-factor authentication, OIDC sign-in (SSO) and API tokens.

  • TCP/UDP streamsDocs

    Forwards ports that aren't HTTP, such as a game server or MQTT, and logs each connection.

  • Notifications and backupsDocs

    Sends notifications to Discord, Telegram or a webhook and backs up and restores the configuration. DDNS and Cloudflare Tunnel are managed from the web UI too.

Install

Installs on a Linux server with Docker and Docker Compose.

Requirements

  • Docker 24.0 or later and Docker Compose v2
  • A linux/amd64 or linux/arm64 host (Raspberry Pi 4/5 and other ARM64 servers work)
  • Ports 80, 443 and 81 free on the host
  • (Optional) a MaxMind license key for GeoIP
AddressUsed for
https://your-server:81Admin UI
http://your-serverProxy (HTTP)
https://your-serverProxy (HTTPS)

The first login is admin / admin. Nothing else works until you change that password. Keep the admin UI (port 81) off the internet, on your LAN or behind a VPN.

To update, run docker compose pull and then docker compose up -d in the install folder. The installation docs have the details.

# 1. Create directory
mkdir -p ~/nginx-proxy-guard && cd ~/nginx-proxy-guard

# 2. Download files
wget https://raw.githubusercontent.com/svrforum/nginxproxyguard/main/docker-compose.yml
wget -O .env https://raw.githubusercontent.com/svrforum/nginxproxyguard/main/env.example

# 3. Auto-generate secure secrets
sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=$(openssl rand -base64 24)/" .env
sed -i "s/JWT_SECRET=.*/JWT_SECRET=$(openssl rand -hex 32)/" .env

# 4. Start services
docker compose up -d

Recent changes

  • v2.72.92026-11-26On a host using the geo challenge or ForwardAuth, an upload larger than the global "max…
  • v2.72.82026-11-25A 403 returned by the site itself showed in the logs as a bot-filter block, so a site…
  • v2.72.72026-11-25The global Fail2ban jail could not be switched on while Trusted Proxies was empty.
  • v2.72.62026-11-23The dashboard charts, the traffic graphs, a banned IP's recent connections and other…

Full changelog