Hello,

I am working with NiFi 1.5.0 and I have created a customer service controller 
for my project. I am able to add my controller service to my NiFi flow 
configuration, but I am unable to enable that controller service without first 
encountering error messages that I need to dismiss. After that the controller 
services do appear to be enabled, but then I can’t disable them.

This problem does not occur when I connect directly to my NiFi application from 
the browser. But it does not work when NiFi is deployed behind an Nginx reverse 
proxy that is how we deploy things in production. I have configured Nginx to 
set headers as described at 
https://community.hortonworks.com/articles/113240/running-apache-nifi-behind-a-proxy-2.html
 
<https://community.hortonworks.com/articles/113240/running-apache-nifi-behind-a-proxy-2.html>.
 Specifically, my Nginx configuration looks like this:

location /workflow/ {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-ProxyScheme $scheme;
    proxy_set_header X-ProxyHost $host;
    proxy_set_header X-ProxyPort $server_port;
    proxy_set_header X-ProxyContextPath "/workflow/";
    proxy_pass http://127.0.0.1:8080/;
}

This appears to work for most operations: I can configure my processors, start 
and stop them, etc. But when I try to click the button to enable my service 
controller, the proxy settings set up in my Nginx configuration above don’t 
seem to be honored.

As an example, here the HTTP request I see in developer tools for starting a 
processor looks like this:

PUT 
http://vi-codex.eng.local/workflow/nifi-api/processors/5d8deeca-015e-1000-be6e-151bd1c4b56a

But when I click on the button to enable my controller service, the HTTP 
request looks like this:

GET 
http://vi-codex.eng.local/nifi-api/flow/bulletin-board?sourceId=4e9f82cf-0162-1000-ee16-fb9ce9599ac6

As you can see, the “/workflow” context path I set via Nginx is being used for 
the first (and every other) request, but not when I try to enable or disable a 
service controller. For enabling and disabling, I get an error because it 
attempts to access “nifi-api” without properly prefixing it with the correct 
context path.

Have I done something wrong in my configuration that is causing this? Or is 
this a bug in NiFi 1.5?

Thanks

-Tim

Reply via email to