diff --git a/leancloud/engine/https_redirect.py b/leancloud/engine/https_redirect.py
index <HASH>..<HASH> 100644
--- a/leancloud/engine/https_redirect.py
+++ b/leancloud/engine/https_redirect.py
@@ -1,18 +1,23 @@
 # coding: utf-8
 
+import os
+
 from werkzeug.wrappers import Request
 from werkzeug.utils import redirect
 
 __author__ = 'asaka <lan@leancloud.rocks>'
 
 
+is_prod = int(os.environ.get('LC_APP_PROD', '0'))
+
+
 class HttpsRedirectMiddleware(object):
     def __init__(self, wsgi_app):
         self.origin_app = wsgi_app
 
     def __call__(self, environ, start_response):
         request = Request(environ)
-        if request.headers.get('X-Forwarded-Proto') == 'http':
+        if is_prod and request.headers.get('X-Forwarded-Proto') != 'https':
             url = 'https://{0}{1}'.format(request.host, request.path)
             if request.query_string:
                 url += '?{}'.format(request.query_string)
https redirect only works on production env