I think it depends on your SSL certificate provider. For Let’s Encrypt these instructions ought to do the trick: