Sure, minimal attack surface is always a good idea.
However, assuming security never is.
All you need in order to exploit the current nginx CVE is a website serving static html pages.
> The vulnerabilities allow unauthenticated remote code execution in NGINX itself, independent of the application running behind it.
> CVE-2026-123007 was confirmed on 64-bit servers over HTTPS, even when serving static files only.
This particular vulnerability resides in the HTTP2 support, which must be enabled by the server operator. Disabling such less hardened features is maybe even more important in reducing attack surface than only reasoning about the applications being run.
https://research.jfrog.com/post/nginx2shell-all-you-need-to-...