HUE behind reverse-proxy with custom sub-domain

212 views
Skip to first unread message

Shannon Schlueter

unread,
Oct 31, 2016, 10:21:29 AM10/31/16
to Hue-Users
I'm attempting to set up access to HUE via a reverse proxy (https://some.domain/hue/) that is externally addressable on port 443. 
The HUE service is currently running on an internal host (https://internal.host:8888/) that is not addressable outside the organizations firewall.  

Using nginx, the reverse proxy works fine for the first pass, but as expected links returned by the HUE service are relative to a document root of '/' as they would/should be if you accessed HUE using the internal.host URL directly. 

I need to have HUE/django resolve the URLs such that the URI/Path has a prepended '/hue/' whenever requests come through the reverse proxy. With previous django projects, I've been able to accomplish this by having nginx add either a SCRIPT_NAME or X-Script-Name HTTP header. In essence, these set a SCRIPT_NAME environment variable that the WSGI/django.wsgi layer picks up and prepends to the URI's that the urlresolver returns thus giving a dynamic url based on how the client perceives (accesses) the service.

I know that the version of django used by HUE has a problem with dynamically resolving 'Static' urls in this way, so I've created a separate reverse proxy entry for those.

Doing all of these combinations I can think of, I've been unable to get HUE to adjust the URI however. I was able to use the FORCE_SCRIPT_NAME='/hue' configuration which resolved the urls in the proper way, but does so in a non-dynamic way such that now access using the internal.host URL picks up incorrect URIs.

Is this possible? Has anyone had success setting this up?

If dynamic URI resolution isn't possible, does anyone know how to have HUE run from an application mount-point other than '/' (for instance '/hue' :)?

Thanks,
Shannon
Reply all
Reply to author
Forward
0 new messages