Support for https reverse proxy

Use the x-forwarded-proto to detect if the reverse proxy is using https.
This should help to make some apps work out of the box with https enabled.