2.5.2 Ensure default error and index.html pages do not reference NGINX

Information

Default error pages (e.g., 404, 500 ) and the default welcome page often contain NGINX branding or signatures. These pages should be removed or replaced with generic or custom-branded pages that do not disclose the underlying server technology.

Standard NGINX error pages visually identify the server software, even if headers are suppressed. By gathering information about the underlying technology stack, attackers can tailor their exploits to known vulnerabilities of NGINX. Replacing default pages with generic or branded content removes this information leakage vector and increases the effort required for successful reconnaissance.

NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

Instead of editing the default files (which may be overwritten by package updates), configure NGINX to use custom error pages.

1. Create Custom Error Pages:

Create a directory (e.g., /var/www/html/errors ) and place generic HTML files there (e.g., 404.html, 50x.html ) without NGINX branding.

2. Configure NGINX:

Add the error_page directive to your http or server blocks:

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /var/www/html/errors;
internal;
}

Impact:

Creating and maintaining custom error pages requires additional administrative effort. Ensure that custom error pages are simple and do not themselves introduce vulnerabilities.

See Also

https://workbench.cisecurity.org/benchmarks/18528

Item Details

Category: SYSTEM AND SERVICES ACQUISITION

References: 800-53|SA-3, CSCv7|18.1

Plugin: Unix

Control ID: 28732d03a1aa123e8e110eaca2b70a32798d52248a8bffb0854f2768d7a8fcc6