We have a setup that I assume is quite common: A publicly accessible Nimbus running Storm UI. The worker
nodes can only be accessed from the Nimbus (via the LAN). All the nodes have internal DNS names (i.e.
node.lan.example.com
), which is set in the configuration files; they use these DNS names to reach each
other. The Nimbus has an external DNS name (storm.example.com
) for public access. The Nimbus's UI is
behind an Nginx proxy, which provides HTTP Auth and HTTPS.
Because of this setup, the logviewer links in the UI do not work. In order to fix this, we employ an elaborate hack shown in the conf file below. It uses ngx_http_substitutions_filter_module to rewrite content returned by the Storm UI and some complicated URL rewrite tricks to proxy the workers' logviewers through through the Nimbus.
A particularly difficult problem to solve was introduced by the urlencoded slashes in file paths. Getting that to pass through the proxy with the rest of the URL intact was not easy. The solution is the final block in the file.