Explorar el Código

HUE-2072 [core] Adding support for HTTPS load-balancing

In order to support HTTPS load-balancing that is terminated at the load-balancer level, Hue needs to know that the request came through HTTPS. Django officially supports this by adding SECURE_PROXY_SSL_HEADER to the settings.py file and specifying the HTTP header (X-Forwarded-Protocol) to be set to https.

https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header

At the load-balancer level you need to set that HTTP header. Here is the HAProxy example:

```
reqadd X-Forwarded-Protocol:\ https
```
Istvan hace 11 años
padre
commit
b69811f
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      desktop/core/src/desktop/settings.py

+ 3 - 0
desktop/core/src/desktop/settings.py

@@ -345,6 +345,9 @@ if OAUTH_AUTHENTICATION:
 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')
+
 ############################################################
 
 # Necessary for South to not fuzz with tests.  Fixed in South 0.7.1