What Is New in NGINX 1.12
NGINX 1.12 is a stable branch that introduces several key features focused on enhanced load balancing and improved logging capabilities. This release builds on the foundation of previous versions to offer more granular control for production environments.
| Category | Key Changes |
|---|---|
| New Features | Dynamic modules support, additional variables for logging |
| Core Improvements | SSL performance optimizations, better handling of backend failures |
| Bug Fixes | Resolved issues in the stream module and memory handling |
What are the main new features in this release?
The headline addition is the official support for dynamically loading modules. Before 1.12, you had to compile modules statically into the NGINX binary. Now you can load them at runtime using the new load_module directive, which makes adding functionality much more flexible.
This is a game-changer for maintainability. You can update or add modules without needing to recompile your entire NGINX installation from source, which simplifies deployment and reduces downtime.
How did logging get better?
NGINX 1.12 added more variables to provide deeper insight into upstream interactions. You now have access to new variables like $upstream_connect_time and $upstream_first_byte_time for more detailed logging of TCP connection times and time-to-first-byte from backends.
In practice, this means your access logs can paint a much clearer picture of where latency is actually occurring-whether it's in the network connection handshake or waiting for the application server to start sending data.
Were there any performance tweaks?
Yes, this release included optimizations for SSL/TLS performance and more efficient connection handling. The work focused on reducing CPU overhead during SSL handshakes and improving how worker processes manage connections, especially under heavy load.
You might not see dramatic benchmark differences, but these incremental gains help NGINX handle more concurrent encrypted connections efficiently, which matters for high-traffic sites.
What about the stream module?
The stream module, which handles TCP and UDP load balancing, received several important bug fixes. These fixes addressed specific edge cases where improper handling of connections or backend failures could lead to unexpected behavior or resource leaks.
If you're using NGINX as a Layer 4 load balancer for database clusters or custom TCP services, these fixes make the proxy more robust and reliable in production.
FAQ
Can I upgrade to NGINX 1.12 from 1.10 without breaking my config?
Generally, yes. The 1.12 stable branch maintains configuration compatibility with previous 1.x versions. Your existing config files should work without modification. Always test in a staging environment first, especially if you use third-party modules.
Do I have to use dynamic modules now?
No, dynamic modules are entirely optional. You can continue to compile modules statically as before. The dynamic loading feature just provides a new, more flexible option for managing modules.
How do I start using the new logging variables?
You simply add them to your log_format directive. For example: log_format custom '$remote_addr - $upstream_connect_time $upstream_first_byte_time'; Then apply that format to an access_log directive.
Is the health check behavior different in this version?
The core passive health check mechanism for upstream servers remains the same. The improvements are more about resilience, ensuring that failed servers are properly marked down and that connections are cleaned up correctly.
Were any security vulnerabilities patched in this release?
The 1.12 changelog does not highlight any specific CVEs. The focus was on feature additions, performance improvements, and general bug fixes rather than security patches. Always check the security advisories page for the most current information.