Configuration on Ubuntu 20.04 - apache 2.4.41:
Enable the headers module
$ sudo a2enmod headers
Edit file /etc/apache2/conf-available/security.conf
and add:
Header always set X-Content-Type-Options: nosniff
Restart Apache
$ sudo systemctl restart apache2
$ culr -I localhost
HTTP/1.1 200 OK
Date: Fri, 23 Oct 2020 06:12:16 GMT
Server:
X-Content-Type-Options: nosniff
Last-Modified: Thu, 22 Oct 2020 08:06:06 GMT