Note: only tested on Ubuntu 20.04.3 LTS. Should work with other versions of Ubuntu Server as well as distros based on Ubuntu or Debian.
Based on reading it seems to not be so easy for other distros however. If you use a distro not derived from Ubuntu or Debian you may need to compile Nginx yourself.
But assuming you're running an Ubuntu server, all you need to do is run this command:
sudo apt install libnginx-mod-http-headers-more-filter