Update nginx.conf to disable server tokens #104
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Server tokens include the version of nginx in the response headers. Disabling them will hide the version.
Description:
With server tokens enabled, the server will respond with the nginx version in every response.
Example (using
curl -I -L www.example.com):By disabling tokens, the response doesn't contain the version:
In the interests of security, there's probably no good reason to give away more information on the nginx version than necessary, especially with utilities like https://www.shodan.io/ constantly scanning the IPv4 space for vulnerable software versions.
I realise this is security by obscurity and it's better for users to keep their software up to date, but in the event of a major nginx bug it should at least make it harder for a would-be attacker to exploit users of this container.
I have read the contribution guidelines, it's not clear if I would need to make an update to a changelog somewhere so please correct me if I do.
Benefits of this PR and context:
It is a minor increase to security.
How Has This Been Tested?
I've tested and deployed the change to my own environment, using
curl -I -L www.example.combefore and after the change.Source / References:
http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens