I'm having the following problem when I try to access the NiFi service inside a VM on a remote server from my local machine.

System Error

The request contained an invalid host header [:] in the request [/nifi/login]. Check for request manipulation or third-party intercept.

Valid host headers are [empty] or:

Does anyone know how to solve this problem?

1

There are 1 best solutions below

0
Richard Silva On

I found the solution for the problem.

I simply accessed the /etc/ directory on linux and made a modification on the hosts file.

This is the host file before the modification.

127.0.0.1       localhost
127.0.1.1       personal-VirtualBox

The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

This is the host file after the modification. I bound a name to the host ip (I'm using an example name and ip)

127.0.0.1       localhost
127.0.1.1       personal-VirtualBox
**156.541.0.21  my.nifi.server**

The following lines are desirable for IPv6 capable hosts

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

After that I modified the nifi.web.https.host in the nifi.properties file in the /conf/ directory of the nifi with the same name that I gave to the ip

**nifi.web.https.host=my.nifi.server**
nifi.web.https.port=8008
nifi.web.https.network.interface.default=
nifi.web.jetty.working.directory=./work/jetty
nifi.web.jetty.threads=200
nifi.web.max.header.size=16 KB
nifi.web.proxy.context.path=
nifi.web.proxy.host=
nifi.web.max.content.size=
nifi.web.max.requests.per.second=30000
nifi.web.max.access.token.requests.per.second=25
nifi.web.request.timeout=60 secs
nifi.web.request.ip.whitelist=
nifi.web.should.send.server.version=true
nifi.web.request.log.format=%{client}a - %u %t "%r" %s %O "%{Referer}i" "%{User-Agent}i"

So when I went to access nifi on my local machine I used the address with the name instead of the ip.

**https://my.nifi.server:8008/nifi**