'how to use nifi.web.proxy.host and nifi.web.proxy.context.path?

I have deployed NiFi with Kerberos in a cluster and for accessing the UI I am using haproxy. I am able to access NiFi UI through the individual node URL but it's not working with the loadbalncer URL and getting following error

System Error

The request contained an invalid host header

I think it can be fixed by nifi.web.proxy.host and nifi.web.proxy.context.path parameters. I tried with this two parameters but the problem still remains.



Solution 1:[1]

This issue was pointed at in NiFi 1.5 NIFI-4761. To resolve this issue, whitelist the hostname used to access NiFi using the following parameter in the nifi.properties configuration file :

nifi.web.proxy.host = <host:port> 

Its a comma-separated list of allowed HTTP Host header values to consider when NiFi is running securely and will be receiving requests to a different host[:port]. For example, when running in a Docker container or behind a proxy (e.g. localhost:18443, proxyhost:443). By default, this value is blank, meaning NiFi should allow only requests sent to the host[:port] that NiFi is bound to.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bot