使用Nginx反向代理进行NiFi身份验证

使用Nginx反向代理进行NiFi身份验证,nginx,apache-nifi,Nginx,Apache Nifi,是否可以在NGINX上使用具有用户身份验证但具有SSL终止的NiFi。我在端口443上运行NGINX,并在端口8080上向nifi传递一个proxy_pass。我玩过这些头球: X-ProxyScheme - the scheme to use to connect to the proxy X-ProxyHost - the host of the proxy X-ProxyPort - the port the proxy is listening on X-ProxyContextPath

是否可以在NGINX上使用具有用户身份验证但具有SSL终止的NiFi。我在端口443上运行NGINX,并在端口8080上向nifi传递一个proxy_pass。我玩过这些头球:

X-ProxyScheme - the scheme to use to connect to the proxy
X-ProxyHost - the host of the proxy
X-ProxyPort - the port the proxy is listening on
X-ProxyContextPath - the path configured to map to the NiFi instance
但似乎不可能让NiFi识别它是在代理背后的https连接上。我更新了身份验证配置,但NiFi仍然抛出错误:

IllegalStateException: User authentication/authorization is only supported when running over HTTPS.. Returning Conflict response.
java.lang.IllegalStateException: User authentication/authorization is only supported when running over HTTPS

基本上,https到nginx的连接比到nifi的http端口的连接要多。

我不熟悉nifi,但在RHEL和nginx上,下面给了我一个反向代理,一个https连接在nginx中终止,一个向前的http连接有一个/abc\u端点。也许您可以将其用作模板

server {
    listen       443 ssl http2 default_server;
    listen       [::]:443 ssl http2 default_server;
    server_name  _;
    root         /usr/share/nginx/html;

    ssl_certificate "/etc/pki/tls/certs/abc.com.crt";
    ssl_certificate_key "/etc/pki/tls/private/abc.com.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers PROFILE=SYSTEM;
    ssl_prefer_server_ciphers on;

    proxy_connect_timeout 7d;
    proxy_send_timeout 7d;
    proxy_read_timeout 7d;

    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location / {
    }

    location /abc_end_point {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://localhost:9090/abc_end_point;
    }

}

您正在尝试在反向代理(nginx)上使用SSL卸载设置Nifi-不支持这种设置。 见:


我建议在反向代理和Nifi之间也使用TLS(HTTPS)。

在Nifi上使用auth会激活HTTPS。因此,您必须将请求定向到nifi https端口。