How do I add HTTP Strict Transport Security (HSTS) to my website?
If you are running Windows Server 2019, open the Internet Information Services (IIS) Manager and click on the website. Click on HSTS. Check Enable and set the Max-Age to 31536000 (1 year). Check IncludeSubDomains and Redirect Http to Https.
For all other versions of Windows Server, open the Internet Information Services (IIS) Manager and click on the website. Double click HTTP Response Headers and add in a new header named "Strict-Transport-Security" The recommend value is "max-age=31536000; includeSubDomains" however, you can customize it as needed.