Skip to content
Back to skills

Nginx Knowledge Patch

ASecurity

NGINX

  • 25 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
developmentrustapibackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill nginx-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nginx Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nginx Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-nginx-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-nginx-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nginx-knowledge-patch
description: NGINX
version: "1.31.10"
license: MIT
metadata:
  author: Nevaberry
---


# NGINX compatibility and configuration

Load this skill for NGINX upgrades, configuration changes, and diagnosis of
HTTP, upstream, TLS, stream, or mail behavior. It also provides explicitly
identified NGINX Plus and freenginx guidance.

## Reference index

| Reference | Topics |
| --- | --- |
| [Core HTTP and runtime](references/core-http-and-runtime.md) | Build and worker behavior, request validation, routing, variables, headers, logging, geo maps, WebDAV, SSI, Perl |
| [Upstreams and proxying](references/upstreams-and-proxying.md) | Connection reuse, DNS, affinity, HTTP/2 backends, request bodies, trailers, FastCGI, redirects, caching |
| [TLS, certificates, and QUIC](references/tls-certificates-and-quic.md) | OCSP, trust, credential caches, TLS libraries, ECH, compression, sessions, ALPN, QUIC |
| [Stream, mail, and protocols](references/stream-mail-and-protocols.md) | Stream listeners, PROXY protocol, mail authentication, Memcached, freenginx mail controls |
| [NGINX Plus operations](references/nginx-plus-operations.md) | Licenses, reporting, package migration, OIDC, JWT, ACME, upstream policy, health checks, management APIs |
| [Security and upgrades](references/security-and-upgrades.md) | Vulnerability conditions, branch-specific fixed releases, historical upgrade floors, patch verification |

## Breaking changes and migration checks

### Build options and worker startup

- Use `./configure --without-http_upstream_sticky_module` to disable the HTTP
  upstream sticky module; `--without-http_upstream_sticky` is deprecated.
- Windows builds of 1.31.8 remove `iocp`. Remove an explicit `iocp` selection
  from `events` to use the default event method.
- 1.31.7 rejects `0` in affected buffer-size directives. Replace zero sizes
  flagged during configuration validation with positive values.
- From 1.31.9, an `initgroups()` failure is fatal during worker initialization.
  Check supplementary group lookup for the configured worker account if workers
  fail to start after upgrading.

### Request validation

From 1.31.0, HTTP/2 and HTTP/3 requests containing `Connection`,
`Proxy-Connection`, `Keep-Alive`, `Transfer-Encoding`, or `Upgrade` are rejected;
`TE` is accepted only with the value `trailers`.

From 1.29.4, chunked request and response bodies require CRLF terminators;
a bare LF is an error. Host and port syntax in the request line, `Host`, and
`:authority` is validated against RFC 3986. 1.31.9 stops processing header lines
that lack a colon and adds flood detection while reading chunked request bodies.

### Upstream defaults and response handling

Since 1.29.7, upstreams default to `keepalive 32 local`: up to 32 idle connections
per worker, with reuse scoped to a location. Use `keepalive 32;` for reuse across
locations with matching upstream addresses, or `keepalive 0;` to disable caching.
HTTP proxying defaults to HTTP/1.1 and omits the upstream `Connection` header.
Use `proxy_set_header Connection ...;` if an explicit value is needed.

From 1.31.4, backend HTTP/2 and gRPC requests always carry `:authority`, and
backend HTTP/1.1 requests always carry `Host`. Incomplete gRPC responses with a
nonzero `Content-Length` are treated as malformed. In 1.31.9, the HTTP proxy uses
`Content-Length: 0` upstream when discarding the client request body.

### Plus installation and module migrations

R33 requires a JWT subscription license for each Plus instance. A newly installed
or upgraded instance requires an initial usage report, followed by hourly reports
over TLS. Traffic processing is blocked if the initial report fails and the
180-day grace period (`mgmt { enforce_initial_report off; }`) is disabled.
Restricted networks can relay reports through NGINX Instance Manager; R34 adds
the reporting `proxy` directive in `mgmt`.

For tracing on R34 or later, use `nginx-plus-module-otel`; the OpenTracing dynamic
module is unavailable. In R30, use `mqtt_buffers` in place of
`mqtt_rewrite_buffer_size`. See the Plus reference for package and API migrations.

## Security-sensitive configurations

For `ssl_early_data`, upgrade to at least 1.30.8 on stable or 1.31.10 on mainline
for the excessive CPU usage fix for CVE-2026-132779.

Stable 1.30.7 and mainline 1.31.9 fix vulnerabilities in the resolver, HTTP/2,
HTTP/3, request body reads over TLS 1.3, the mail proxy, `alias` with `try_files`,
stream client-certificate validation, and stream `ssl_preread`. Mainline 1.31.9
also fixes a PROXY protocol v2 vulnerability. The security reference retains the
individual CVE identifiers, conditions, and branch-specific upgrade guidance.

## Proxying and upstream selection

### HTTP/2 backends and streaming uploads

Use `proxy_http_version 2;` with `proxy_pass` for HTTP/2 upstream proxying.
It requires `ngx_http_v2_module` and defaults `:authority` to `$proxy_host`;
an explicit `Host` header overrides that default.

With `proxy_request_buffering off;`, an HTTP/2 backend can receive an HTTP/1.1
chunked upload as it arrives. Failover is possible only before the proxy starts
sending the body. `proxy_buffer_size` caps HTTP/2 backend headers and trailers;
`grpc_buffer_size` applies the corresponding gRPC limit.

### Runtime DNS and SRV discovery

Standard builds support `server ... resolve` in a shared-memory `zone` from
1.27.3. Set `resolver` in the upstream or enclosing `http` block;
`resolver_timeout` defaults to 30 seconds.

```nginx
upstream app {
    zone app 64k;
    resolver 127.0.0.1;
    resolver_timeout 5s;
    server app.example.com:8080 resolve;
}
```

With `resolve` and a portless hostname, `service=http` looks up
`_http._tcp.<hostname>`. Lowest-priority-value SRV records become primary peers;
the rest become backups. Adding `backup` keeps only the lowest-priority-value
records as backup peers.

### Affinity and response-time balancing

Standard builds support `sticky cookie`, `sticky route`, and `sticky learn`
from 1.29.6. A `route` value supplies a stable server identifier; `drain` limits
a server to requests already bound to it. `sticky learn` records a backend
response cookie in a shared zone and looks up the client's request cookie.
Its optional `sync` parameter requires the commercial edition.

Use `least_time` in an HTTP upstream to balance by backend response times;
`least_time header;` measures time to receive response headers.

### Early Hints and response trailers

Use `early_hints` to forward HTTP 103 responses from proxy or gRPC backends
before the final response.

```nginx
location / {
    proxy_pass http://127.0.0.1:8080;
    early_hints 1;
}
```

Use `proxy_pass_trailers on;` to forward proxied response trailers.
For an HTTP/1.1 backend, advertise trailer support on the upstream request:

```nginx
proxy_http_version 1.1;
proxy_set_header Connection te;
proxy_set_header TE trailers;
proxy_pass_trailers on;
```

## TLS credentials and client verification

`ssl_certificate_cache max=1000;` caches server certificates and keys loaded
through variables. Upstream equivalents are `proxy_ssl_certificate_cache`,
`grpc_ssl_certificate_cache`, and `uwsgi_ssl_certificate_cache`.
For `proxy_ssl_certificate_cache`, defaults are `inactive=10s` and `valid=60s`:
inactivity evicts an entry; `valid` bounds reuse before reload or revalidation.

For stream client-certificate OCSP, enable client verification and configure
a resolver for OCSP responder hostnames:

```nginx
ssl_verify_client on;
ssl_client_certificate /etc/nginx/tls/client-ca.pem;
ssl_ocsp on;
resolver 127.0.0.1;
```

To verify client certificates while keeping trusted CA names out of the
handshake, configure `ssl_trusted_certificate` and omit `ssl_client_certificate`.
In HTTP and stream, `ssl_ocsp leaf;` restricts validation to the leaf certificate;
`ssl_ocsp_responder` accepts only `http://` URLs.

`ssl_ech_file` configures ECH on builds using the OpenSSL ECH feature branch.
`$ssl_sigalg` and `$ssl_client_sigalg` are available only for new TLS sessions
and are empty with OpenSSL older than 3.5. Certificate compression requires
OpenSSL 3.2 or newer on OpenSSL builds and is disabled when OCSP stapling is active.

## HTTP configuration controls

Use `add_header_inherit merge;` to retain inherited response headers alongside
entries in the current block, and `add_trailer_inherit merge;` for trailers.
`keepalive_min_timeout` protects reusable client connections from early
server-side closure, including graceful worker shutdown; it defaults to `0`.
`max_headers 100;` caps request headers at 100. `client_body_early_read` controls
early reading of the client request body.

## Stream protocols and product-specific behavior

The stream and mail `proxy_protocol` directive supports PROXY protocol v2
for upstream connections. In a stream server, `proxy_ssl_alpn` advertises an
application protocol to a TLS upstream. `pass 127.0.0.1:8080;` hands a stream
connection to another configured listener.

In freenginx 1.29.0, `limit_rate` uses a leaky bucket and `limit_rate_after`
sets the allowed burst size. freenginx 1.29.1 rejects HTTP/0.9 proxy responses
by default; use `proxy_allow_http09 on;` for an upstream that still sends them.
The freenginx sections preserve its separate TLS, cache, mail, and GeoIP2 behavior.

For Plus, the operations reference covers OIDC and JWT authentication, native
ACME, dynamic upstream binds and requests, health checks, and management metrics.

Files in this skill

  • SKILL.md7.5 KB
  • references/http-and-transport.md1.7 KB
  • references/tls-and-security.md1.2 KB
  • references/upstream-and-load-balancing.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.