diff --git a/storage.module b/storage.module
index 0cba4c7..e4f861e 100644
--- a/storage.module
+++ b/storage.module
@@ -1027,8 +1027,8 @@ function storage_data_uri_doc_link() {
  * @return bool
  *   TRUE if using HTTPS.
  */
-function storage_is_request_https() {
-  return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
+function storage_is_request_https() {gs
+  return (!empty($_SERVER['HTTPS'])) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');
 }
 
 /**
