gpt4 book ai didi

nginx - 在 Nginx 后面运行 Apache NiFi

转载 作者:行者123 更新时间:2023-12-04 13:43:51 26 4
gpt4 key购买 nike

我正在尝试使用 nginx 作为反向代理连接到 nifi。
我正在使用以下流程:
本地机器 -> http -> NGINX -> https -> 安全 NiFi

以下是我的 nifi.properties 配置:

nifi.web.https.host=localhost
nifi.web.https.port=8443
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/
nifi.web.proxy.host=localhost:8443
nifi.remote.input.host=localhost
nifi.remote.input.secure=true

以下是我的 nginx 配置:
 server {
listen 81;
server_name localhost;
location /nifi/ {

proxy_ssl_certificate C:/nifi-toolkit-1.7.1/target/nifi-cert.pem;
proxy_ssl_certificate_key C:/nifi-toolkit-1.7.1/target/nifi-key.key;
proxy_ssl_server_name on;

proxy_pass https://localhost:8443;
proxy_set_header X-ProxyScheme "https";
proxy_set_header X-ProxyHost $http_host;
proxy_set_header X-ProxyPort 8443;
proxy_set_header X-ProxyContextPath "";
root html;
index index.html index.htm;
}

location /nifi-api/{

proxy_ssl_certificate C:/nifi-toolkit-1.7.1/target/nifi-cert.pem;
proxy_ssl_certificate_key C:/nifi-toolkit-1.7.1/target/nifi-key.key;
proxy_ssl_server_name on;

proxy_set_header X-ProxyScheme "https";
proxy_set_header X-ProxyHost $http_host;
proxy_set_header X-ProxyPort 443;
proxy_set_header X-ProxyContextPath "";
proxy_pass https://localhost:8443/nifi-api/;
}
}

当我尝试通过 nginx 访问 nifi 时,我在 error.logs 中收到以下错误:
2018/09/25 15:41:55 [error] 100964#77892: *27 upstream timed out (10060: A `connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "POST /nifi-api/access/oidc/exchange HTTP/1.1", upstream: "https://[::1]:8443/nifi-api/access/oidc/exchange", host: "localhost:81", referrer: "http://localhost:81/nifi/"`

以下是我点击 url 时在浏览器中遇到的错误: http://localhost:81/nifi/

upstream timed out while calling nifi over nginx via https

是否有任何我遗漏的配置设置。任何帮助将不胜感激。

先感谢您。

最佳答案

问题是 nifi.web.proxy.context.path 设置不正确。

检查文档:

https://docs.hortonworks.com/HDPDocuments/HDF3/HDF-3.3.0/nifi-configuration-best-practices/content/proxy_configuration.html

NiFi will only accept HTTP requests with a X-ProxyContextPath or X-Forwarded-Context header if the value is whitelisted in the nifi.web.proxy.context.path property in nifi.properties. This property accepts a comma separated list of expected values. In the event an incoming request has an X-ProxyContextPath or X-Forwarded-Context header value that is not present in the whitelist, the "An unexpected error has occurred" page will be shown and an error will be written to the nifi-app.log.

关于nginx - 在 Nginx 后面运行 Apache NiFi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52496136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com