diff --git a/storage.module b/storage.module
index c3f29baceb..5aa79a45b2 100755
--- a/storage.module
+++ b/storage.module
@@ -784,7 +784,7 @@ function storage_data_uri_doc_link() {
 }
 
 function storage_is_request_https() {
-  return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
+  return (!empty($_SERVER['HTTPS'])) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');
 }
 
 /**
