Check out example codes for "add hsts domain". It will help you in understanding the concepts better.

Code Example 1

Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS

Learn ReactJs, React Native from akashmittal.com