1.Hide details about Nginx
By-default the Nginx version is shown in the response headers as shown below.
Having such information will facilitate a hacker in an attempt at attacking the web server.
Disable the information leakage by adding the line below in
Save the file and reload nginx
Confirm that the nginx version details are no longer shown.
2.Enable X-XSS Protection
X-XSS protects the web server against cross-site scripting attacks. Add the line add_header
3.Disable Undesirable HTTP methods
The desirable HTTP methods include POST, HEAD, GET while the undesirable ones are DELETE or TRACE. These are quite risky as they give provision of stealing cookie information through cross-site tacking attacks.
To disable this add the line below in
Save the file and reload nginx service
4.Prevent clickjacking attacks
Clickjacking attack entails hacker placing a hidden link below legitimate button on site and the user unknowingly clicks on the attacker’s link causing malice. In most cases, this is done using iframes. Hence in nginx, it’s recommended to insert X-FRAME-OPTIONS “SAMEORIGIN” in the header to limit the browser to load resources only from the same origin.
Add the line
Save the file and reload nginx service
5.Always keep nginx up to date
The nginx updates will always ensure that any security vulnerabilities in previous versions or releases have been resolved. Just run the command below:
Special note: HostAdvice’s hosting reviews allow you to consult with thousands of users before purchasing a hosting plan. If you are looking to purchase a CentOS VPS plan, consult the VPS hosting reviews or Linux Hosting reviews.
Comments
Post a Comment