首页 > 解决方案 > 如何使用 IIS 作为代理设置 Apache NiFi

问题描述

我在 Windows 服务器上运行 Apache NiFi。我已经设置了 HTTPS 访问并通过 LDAP 将其连接到我的 AD 以进行用户身份验证。属性的值是nifi.web.https.host6444 ,我可以通过https://localhost:6444/nifi访问 Web UI ,没有任何问题。localhostnifi.web.https.port

我现在想将 NiFi 设置为在同一台服务器上的 IIS 后面运行,以便 IIS 充当代理。我在 IIS 中创建了一个新站点,并在其 web.config 文件中配置了 URL 重写规则,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
<rule name="NiFi Reverse Proxy" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="https://localhost:6444/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

IIS 和 NiFi 都使用我组织的相同 SSL 证书。

我已将文件中的nifi.web.proxy.host属性配置为.nifi.propertiesnifi01.myorg.com:443

我可以从外部计算机访问https://nifi01.myorg.com/nifi 。我看到登录页面并且能够成功登录。但是,授权完成后,我被重定向到https://localhost:6444/nifi。如果在同一个浏览器会话中我输入https://nifi01.myorg.com/nifi,那么我可以看到主要的 Nifi 工作流 UI,它告诉我登录过程确实有效。

有人可以帮助我重定向到https://localhost:6444/nifi 吗?web.config 或 nifi.properties 文件中是否缺少某些内容?

我发现这篇文章https://community.hortonworks.com/articles/113240/running-apache-nifi-behind-a-proxy-2.html因为不知道在 IIS 中的位置而无法关注设置应该去。

标签: iisreverse-proxyapache-nifi

解决方案


推荐阅读