Can one NiFi node have multiple host names?

Viewed 470
Problem:
    Not able to allow multiple host names for one single NiFi node.
Description:
    I have an internal NiFi server with internal computer name 'nifi-1'. nifi.properties has the following:
      nifi.web.https.host=0.0.0.0
      nifi.web.https.port=9443
This works fine when I hit "https://nifi-1:9443/nifi/" internally.
I have another dns name - "nifi-1.company.com" (both names must be supported) that is routed to the same nifi node. The nifi node rejects with the following error messages when I hit "https://nifi-1.company.com:9443/nifi/":


System Error
    The request contained an invalid host header [nifi-1.company.com:9443] in the request [/nifi]. Check for request manipulation or third-party intercept.
    Valid host headers are [empty] or:
    127.0.0.1
    127.0.0.1:9443
    localhost
    localhost:9443
    [::1]
    [::1]:9443
    nifi-1
    nifi-1:9443
    10.0.1.82
    10.0.1.82:9443
    0.0.0.0
    0.0.0.0:9443

Question:
  How to resolve this problem? Any solutions? (Thanks!) 
  • Another way to phrase the question is how I may add more host names into the list of "valid host headers" as the above.
1 Answers

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.

original answer source: how to use nifi.web.proxy.host and nifi.web.proxy.context.path?

Related