I want to allow HSTS on SUBDOMAIN ONLY (test.example.com) on nginx and NOT ON DOMAIN, because I simply do not have any host linking to my original domain in my application (example.com), this means I only have dubdomains in my nginx configuration.
I tried to add the header in the directory as supposed:
server {
listen 80;
listen [::]:80;
server_name test.example.com;
add_header Strict-Transport-Security max-age=31536000;
....
....
}
but it didnt work.
What to do in this case? Am I not allowed to enable HSTS in case am not using direct domain access to my app? Or am I missing something?
nginx version: nginx/1.10.3 (Ubuntu)