浏览代码

HUE-2072 [core] Updating Proxy SSL support to be optional

Istvan 11 年之前
父节点
当前提交
b293f95
共有 3 个文件被更改,包括 10 次插入2 次删除
  1. 3 0
      desktop/conf.dist/hue.ini
  2. 5 1
      desktop/conf/pseudo-distributed.ini.tmpl
  3. 2 1
      desktop/core/src/desktop/settings.py

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -69,6 +69,9 @@
   # Help improve Hue with anonymous usage analytics.
   # Use Google Analytics to see how many times an application or specific section of an application is used, nothing more.
   ## collect_usage=true
+  
+  # SECURE_PROXY_SSL_HEADER support for HTTPS termination at the load-balancer level
+  ## SECURE_PROXY_SSL_HEADER=true
 
   # Comma-separated list of Django middleware classes to use.
   # See https://docs.djangoproject.com/en/1.4/ref/middleware/ for more details on middlewares in Django.

+ 5 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -78,7 +78,11 @@
   # Help improve Hue with anonymous usage analytics.
   # Use Google Analytics to see how many times an application or specific section of an application is used, nothing more.
   ## collect_usage=true
-
+  
+  # SECURE_PROXY_SSL_HEADER support for HTTPS termination at the load-balancer level
+  ## SECURE_PROXY_SSL_HEADER=true
+  
+  
   # Comma-separated list of Django middleware classes to use.
   # See https://docs.djangoproject.com/en/1.4/ref/middleware/ for more details on middlewares in Django.
   ## middleware=desktop.auth.backend.LdapSynchronizationBackend

+ 2 - 1
desktop/core/src/desktop/settings.py

@@ -346,7 +346,8 @@ if desktop.conf.REDIRECT_WHITELIST.get():
   MIDDLEWARE_CLASSES.append('desktop.middleware.EnsureSafeRedirectURLMiddleware')
 
 #Support HTTPS load-balancing
-SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
+if desktop.conf.SECURE_PROXY_SSL_HEADER.get():
+  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
 
 ############################################################