HTTPS and Sub-Domains on Same Server

I have my staging and production sites on the same server. Production is HTTPS, and staging is HTTP.

Because of the security features in the deploy strategy (not complaining about it, obviously), it has HSTS enable. so my staging http://stg.mydomain.com throws an error in Chrome and won’t let me continue to the site. but https://www.mydomain.com works just fine.

How do I configure my server.yml provisioning to say only www.mydomain.com needs the HTTPS, and don’t apply it to any other sub-domains on the same server?

See this recent change to Trellis which supports customizing the HSTS settings:

1 Like