預設安裝好 nginx 會有 web server 版本資訊的 header

如下圖

 

為了資訊安全上面的考量,建議將 /etc/nginx/nginx.conf server_tokens off; 打開

這樣就不會在 header 顯示 nginx 的版本資訊。

 

如果你想進一步將此 header 完全移除掉的話,可以考慮裝 nginx 的更改 header module

這樣就可以設定 more_clear_headers Server; 移除此 header。

 

參考資料:

https://serverfault.com/questions/214242/can-i-hide-all-server-os-info

https://geekflare.com/wp-content/uploads/2016/05/nginx-default-header.png

Leave a Reply