For the life of me I can't get to the NiFi Web UI. It makes me hate security.
TLDR; I can't find the right way to start NiFi in a docker container and still access the UI. Here's what I've tried (for 8 hours):
docker run --name nifi \
-p 8080:8080 \
-d \
apache/nifi:latest
I go to localhost:8080/nifi
- timeout. Same on 127.0.0.1
.
docker inspect nifi
- IP Gateway is 172.20.0.1
with actual IP of 172.0.0.2
. Invalid Host Header
and timeout, respectively.
Start randomly trying stuff:
# I tried localhost, 0.0.0.0, various IP addresses
docker run --name nifi \
-p 8080:8080 \
-e NIFI_WEB_HTTP_HOST=${hostname-here}
-d \
apache/nifi:latest
I also built a full docker-compose.yml
for my diminishingly-possible stack. Everything thing works except for:
nifi:
image: apache/nifi:latest
hostname: nifi
depends_on:
- zookeeper
- broker
- schema_registry
- nifi-registry
ports:
- "8080:8080"
No changes. Can you help me?
Updates 1
I used the docker-compose.yml
file from the repo linked in comments below; thank you @Chaffelson. Still dealing with timeout on localhost
. So I spun up a droplet with docker-machine.
The services start fine, and logs indicate Jetty server is up for both NiFi Registry and NiFi. I can access NiFi registry @ <host ip>:18080/nifi-registry
exactly like I can on my local machine.
I can't access <host ip>8080/nifi
- I get invalid host header
response.
So I added to docker-compose.yml
:
environment:
# Tried both with and without quotes
NIFI_WEB_HTTP_HOST: "<host-ip>"
Jetty server fails to start. Insight?
Updates 2
From the logs, using just docker run --name nifi -p 8080:8080 -d apache/nifi:1.5.0
:
[NiFi Web Server-24] o.a.n.w.s.HostHeaderSanitizationCustomizer Request host header [45.55.36.15:8080] different from web hostname [348146fc286f(:8080)]. Overriding to [348146fc286f:8080/nifi]
where 45.55.36.15
is the host ip.
This is the crux of my problem.
Updates 3
I disabled ufw
(firewall) on my local machine. I can now access nifi via localhost:8080
. No progress on actually accessing on a remote host (which is the point of all this).