首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用nginx代理nifi

使用nginx代理nifi
EN

Server Fault用户
提问于 2018-11-24 11:07:01
回答 2查看 3.3K关注 0票数 1

我想使用https nginx代理运行在同一个框中的非安全nifi服务器。

到目前为止,我得到的最接近的方法是使用以下配置:

代码语言:javascript
复制
location ^~ /nifi {
            proxy_set_header X-ProxyHost localhost;
            proxy_set_header X-ProxyPort 6969;
            proxy_set_header X-ProxyContextPath /nifi;

            proxy_pass http://localhost:6969/nifi;
    }

在nifi中,我得到了例外:

代码语言:javascript
复制
2018-11-24 17:40:19,473 ERROR [NiFi Web Server-20] o.a.nifi.web.api.config.ThrowableMapper An unexpected error has occurred:
javax.ws.rs.core.UriBuilderException: The provided context path [/nifi] was not whitelisted []. Returning Internal Server Error response.
javax.ws.rs.core.UriBuilderException: The provided context path [/nifi] was not whitelisted []
        at org.apache.nifi.web.util.WebUtils.verifyContextPath(WebUtils.java:152)
        at org.apache.nifi.web.util.WebUtils.getResourcePath(WebUtils.java:125)
        at org.apache.nifi.web.api.ApplicationResource.buildResourceUri(ApplicationResource.java:159)
        at org.apache.nifi.web.api.ApplicationResource.generateResourceUri(ApplicationResource.java:141)
        at org.apache.nifi.web.api.ProcessorResource.populateRemainingProcessorEntityContent(ProcessorResource.java:107)
        at org.apache.nifi.web.api.ProcessorResource.populateRemainingProcessorEntitiesContent(ProcessorResource.java:95)
        at org.apache.nifi.web.api.FlowResource.populateRemainingFlowStructure(FlowResource.java:200)
        at org.apache.nifi.web.api.FlowResource.populateRemainingFlowContent(FlowResource.java:187)
        at org.apache.nifi.web.api.FlowResource.getFlow(FlowResource.java:373)

有什么暗示吗?

EN

回答 2

Server Fault用户

发布于 2019-02-05 12:58:58

除了答案上图之外,还可以尝试添加X-ProxyScheme头。

此外,如果您正在为您的站点进行外部访问广告,请将X-ProxyHost修改为您的局域网可访问IP地址或Internet可访问域名。(即mynifiwebaccess.com10.51.102.9)

代码语言:javascript
复制
location ^~ /nifi {

    proxy_set_header X-ProxyScheme https;
    proxy_set_header X-ProxyHost mynifiwebaccess.com;
    proxy_set_header X-ProxyPort <externally_advertised_port_number>;
    proxy_set_header X-ProxyContextPath /nifi;

    proxy_pass http://localhost:6969;

}

我不确定您的配置,但是您可以尝试为上面代码中的externally_advertised_port设置端口号,因为NiFi可能已经在运行并使用端口6969了。

票数 0
EN

Server Fault用户

发布于 2019-05-09 05:18:47

错误消息: javax.ws.rs.core.UriBuilderException:提供的上下文路径/nifi没有白化[]。

这是由nifi.web.proxy.context.path没有正确设置引起的。

检查医生:

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

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/941438

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档