Hue Behind HTTPS Proxy

Posted 04 Nov 2010 to hadoop, hue and has Comments

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:

The Hue server can not be reached. (Is the server running ?)

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:

  1. Edit the file

and remove the location fix from the BaseHander.response_fixes property.

  1. 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.