Nginx: How to redirect to https, but not for subdomain

On the nginx SSL config:

Find the the code add_header Strict-Transport-Security:

server {
    listen 443 ssl;
    server_name www.example.com;
    ....
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
}

Please remove the param includeSubDomains. The correct code is :

server {
    listen 443 ssl;
    server_name www.example.com;
    ....
    add_header Strict-Transport-Security "max-age=31536000;";
}

This will not apply SSL on the subdomain.