我想使用https nginx代理运行在同一个框中的非安全nifi服务器。
到目前为止,我得到的最接近的方法是使用以下配置:
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中,我得到了例外:
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)有什么暗示吗?
发布于 2019-02-05 12:58:58
除了答案上图之外,还可以尝试添加X-ProxyScheme头。
此外,如果您正在为您的站点进行外部访问广告,请将X-ProxyHost修改为您的局域网可访问IP地址或Internet可访问域名。(即mynifiwebaccess.com、10.51.102.9)
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了。
发布于 2019-05-09 05:18:47
错误消息: javax.ws.rs.core.UriBuilderException:提供的上下文路径/nifi没有白化[]。
这是由nifi.web.proxy.context.path没有正确设置引起的。
检查医生:
https://serverfault.com/questions/941438
复制相似问题