











NGINX 1.31.4 is an incremental release focused on the protocols we all depend on. Backends behind a stream or mail proxy can now see a client’s TLS details alongside its address thanks to PROXY protocol v2, HTTP/2 and gRPC requests to your upstreams follow the standards more closely, and NGINX has stricter checks on malformed traffic. For NGINX developers out there, there’s also new groundwork for structured data output, and a compatibility fix for a small portion of third-party modules. Here’s what’s new!
What’s new?: The stream and mail proxy modules can now speak PROXY protocol version 2 to your upstreams. Use proxy_protocol v2; to opt in. Version 1 remains the default. (nginx/nginx#1204)
When traffic passes through a load balancer or proxy, the backend server typically only sees the proxy’s IP address. The PROXY protocol solves this “blind spot” by safely passing the original client’s connection details (like source IP and port) to the backend. While v1 accomplished this using a plain-text string, PROXY Protocol v2 introduces a highly optimized, fixed-size binary format. By moving to this binary format, NGINX can now securely carry extensible TLV (Type-Length-Value) metadata to your backends.
Why it matters: Version 1 already gave your backends the client’s address. Version 2 adds the negotiated protocol and the client certificate identity, with no side channel or custom header scheme. That’s what you need when you delegate part of your traffic management (e.g. access control, rate limiting, or audit logging) to a service behind NGINX. Version 2 also lets you interoperate with managed cloud load balancers and private endpoint services that require PROXY protocol v2, while expanding support to UDP datagrams to let you securely proxy real-time gaming, IoT, and custom Layer 4 workloads.
What’s new?: HTTP/2 and gRPC requests to your upstreams now always carry the :authority pseudo-header, and the Host header is no longer sent. If you set a host explicitly with proxy_set_header Host or grpc_set_header Host, that value now goes into :authority, where the upstream expects it. Across HTTP/1.1, HTTP/2, and gRPC alike, an explicitly empty host now falls back to $proxy_host instead of going out empty. (nginx/nginx#1593)
Why it matters: The HTTP/2 and HTTP semantics standards (RFC 9113 and RFC 9110) define that authority information belongs in :authority, and that a host value can’t be empty. Until now, if you overrode the upstream host on an HTTP/2 or gRPC proxy, you had no supported way to reach :authority. The value went into Host instead, and strict upstreams and service meshes rejected the request.
What’s new?: Two validation fixes, one on flow control, one on response length, tighten what NGINX accepts from clients and upstreams, so protocol violations fail visibly instead of passing as success:
Why it matters: Silent successes on malformed inputs are the hardest class of bug to catch in production. An upstream or client that breaks the protocol should fail loudly.
What’s new?: Four bugs that could crash a worker or read uninitialized memory are now fixed:
select event method could write out of bounds and crash when the operating system handed it a high file descriptor. That descriptor is now validated at runtime. (nginx/nginx#1598)Why it matters: You don’t need a malicious client for any of these to cause trouble. A truncated response from an upstream, a failed memory allocation, or a worker with a lot of files open could be enough. These fixes ensure NGINX keeps running smoothly.
What’s new?: Two new core libraries land in this release. ngx_data describes structured data as a tree of typed items (objects, lists, strings, integers, booleans, and null), with declarative handlers to populate that tree from NGINX’s internal structures. ngx_json renders the tree as JSON. (nginx/nginx#1569)
Why it matters: These are libraries for NGINX developers rather than something you might configure. Until now, a module that needed to output structured data wrote both the data handling and the rendering by hand. Now ngx_data describes the data and ngx_json renders it, so modules share that work rather than duplicating it, and the data model stays independent of the output format.
What’s new?: Third-party modules that reuse NGINX’s complex value evaluation work again. An earlier release split that evaluation into two steps, which inadvertently broke modules that only include the first. One caveat: those modules no longer break outright, but until they are updated they risk reading uninitialized memory instead. (nginx/nginx#1601)
Why it matters: If you run a third-party module that broke, upgrading to 1.31.4 gets it working again without waiting on the maintainer. If you maintain one, here’s the fix: wherever your module adds ngx_http_script_complex_value_code to its compiled script, add ngx_http_script_complex_value_end_code after it.
This release also includes a number of smaller improvements:
Starting with this release, we want to start giving more recognition to all our amazing community members that have contributed to this project in this release. Whether you contributed code, helped shape a feature, or reported major bugs, thank you!
Here are the community members (now NGINX contributors!) whose work landed in NGINX since the last release. Between them, they fixed three bugs, in protocol validation, memory safety, and error logging; improved how NGINX uses memory, and how the project runs its CI. In alphabetical order, these are:
The PROXY protocol v2 upstream support was inspired by two prior efforts, both credited in the PR: a commit in the Angie project, and mdewitt11‘s earlier implementation. Thanks to the Angie team and mdewitt11!
Thanks to the researchers and users who reported issues fixed in this release: Matt Suiche (Tolmo Inc.) for the chunked parser overflow detection regression, and Tony Wang for the QUIC stream reset flow control issue.
Head over to the GitHub release page and the CHANGES file for the full picture, and the NGINX documentation for details on the directives mentioned here!
We’re proud of what the team put together, and we can’t wait to share it with the community!

此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。