Hue Behind HTTPS Proxy
One of the things I’ve been working on lately is getting Hue (a browser based interface to Hadoop) up and running in front of LivingSocial’s cluster. One of the biggest problems was getting it to run without issues behind an nginx proxy that provides an SSL (https) wrapper. At first it seems to run fine, until you try to open the file browser or try to look at your Hive tables. At that point, you get an error that says:
It took a while to track down the issue, but the problem actually resides with Django (which is what the web interface was written in). Django rewrites the Location header to make it absolute right before it writes out a 302 redirect response. When it creates the absolute path, it automatically assumes that the protocol is HTTP. This has been a bug for over 3 years. The only way to get Hue to redirect appropriately to a HTTPS location is to:
- Edit the file
and remove the location fix from the BaseHander.response_fixes property. 2. Modify your proxy to rewrite the protocol in the Location header for 302 responses.
In the end, we opted for #2. It was easier than having to patch django each time we upgrade Hue.