If you use Nginx, you can simply add the following code to the server block or http block (for global) in nginx.conf
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
Otherwise, if you can do Apache above, then open the Nginx configuration and enable "Use Nginx as the Apache reverse proxy"
source share