dotCloud provides an additional header: x-forwarded-proto which allows you to know the proxy source.
In your code you can use req.headers['x-forwarded-proto'] ( is either 'http' or 'https' ) to know the source. When it's http you can then redirect to the https.