Using Nginx to proxy Hadoop services web UI:
User --> (https) Nginx --> Hadoop {DATA NODES YARN web UI, webhdfs ...}
When I curl to https://HOST/webhdfs/.....
the webhdfs server redirect to data node:
HTTP/1.1 307 TEMPORARY_REDIRECT
Location: http://DATA-NODE-1:50075/webhdfs ...
Where DATA-NODE-1
is a DNS/IP "intern" to Hadoop cluster so end-user cannot access it.
I want to rewrite the Location
header sent by proxied backend to:
https://50075.DATA-NODE-1.HOST/webhdfs...
(PORT.SERVICE.HOST)
So Nginx can handle it, and do the proxy stuff.
Is it possible with Nginx modules or do I need a LUA/Perl script?