Remove all server info for nginx

nginx, by default, sends information about its use in the Server HTTP header as well as error pages. For example:

nginx/1.22.1

Install additional packages

To remove this, you'll need additional package to be installed: For example in Debian:
sudo apt install libnginx-mod-http-headers-more-filter

Modify nginx config

Modify the following lines in the /etc/nginx/nginx.conf:
http {
...
        server_tokens off;
        more_clear_headers Server;
...
}
Restart nginx:
sudo systemctl restart nginx

Test

Test webserver with curl:
curl -svI qwerty.md