Get the first scheme received in HTTP_X_FORWARDED_PROTO header.

....
Yeah, fixed!