Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

329
Visualizações
Apache NiFi in Docker and Nginx

I'm trying to deploy Apache NiFi in a Docker container on EC2 Instance. Only 2 ports (80 and 443) are open at the moment and I don't have rights to change it.

I've managed to start NiFi:

sudo docker run --name nifi   -p 8080:8080   -d   apache/nifi:latest

Here is my nginx config:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    include /etc/nginx/conf.d/*.conf;
    upstream nifi {
        server 0.0.0.0:8080;
        }
    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        location / {
                proxy_pass http://nifi;
                proxy_set_header Origin http://nifi;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

At the moment NiFi works and I can access it via IP of the instance. proxy_set_header Origin http://nifi; setting fixed a problem with uploading templates to the service.

The problem is that I can't configure any processor at all. Every time, when I click on "configure" I get this error:

Unable to communicate with NiFi
Please ensure the application is running and check the logs for any errors.

enter image description here

Can you please help me to fix this issue?

I can't see anything useful in the logs. Once an error about not using HTTPS has appeared, but I think it's not related.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

After a few days of fiddling with Docker, Nginx and NiFi, I've found the issue. When I've opened network logs in a browser, I've noticed that Nifi was sending a request to 0.0.0.0 or nifi (the name of upstream).

enter image description here

I had to set proxy_set_header X-ProxyHost in my Nginx config file and it worked like a charm. I used public IP of my server, maybe I'll switch to domain name later.

The main problem with this issue was in the lack of logs: I've checked all logs of nifi and nginx and there was nothing interesting. I'm still wondering if this is a bug or not.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda