Making env('HTTPS') respect HTTP_X_FORWARDED_PROTO

Solves an issue with url generation when behind load balancers or proxies which do not set server env https but instead pass HTTP_X_FORWARDED_PROTO as https.