forked from elijh/design-system
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem:
The nginx version number is exposed on 404 error pages, which could be a security concern.
Steps to Reproduce:
- Navigate to a non-existing page on the server.
- Observe the nginx version number displayed on the 404 error page.
Expected Behavior:
The 404 error page should not display the nginx version number.
Proposed Solution:
- Disable server tokens by adding the directive
server_tokens off;in the nginx configuration file to prevent the version number from being displayed. - Implement custom error pages for 404 responses to avoid default nginx error pages. This can be done by adding the following to the nginx config:
error_page 404 /custom_404.html; location = /custom_404.html { root /path/to/your/error/pages; internal; }
- After changes, validate the nginx configuration with
nginx -tand apply the changes by reloading nginx usingsudo systemctl reload nginx.
Action Items:
- Update the nginx configuration to hide server tokens.
- Create and deploy a custom 404 error page.
- Test the new configuration.
- Reload nginx to apply changes.
Please ensure configurations are backed up before making any changes. Also, remember to check for any syntax errors with nginx -t before reloading nginx.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels