简体   繁体   English

Node Red 和 IIS URL Rewrite 有问题

[英]Having issues with Node Red and IIS URL Rewrite

I'm new to both Node-Red as well as IIS.我是 Node-Red 和 IIS 的新手。

I am using URL rewrite to rewrite localhost:1880 to https://example.com which will show the Node Red Flow Editor.我正在使用 URL rewrite 将localhost:1880重写为https://example.com ,这将显示 Node Red Flow Editor。 I managed to get the Node Red Flow editor working fine with the URL rewrite and I am able to access it using https://example.com .我设法使 Node Red Flow 编辑器与 URL 重写一起正常工作,并且我能够使用https://example.com访问它。

I am having issues with accessing the Node Red Dashboard ( localhost:1880/ui ) After doing the URL Rewrite, I am unable to access the dashboard https://example.com/ui .我在访问 Node Red 仪表板 ( localhost:1880/ui ) 时遇到问题 在执行 URL 重写后,我无法访问仪表板https://example.com/ui However, I am still able to do access the dashboard using localhost:1880/ui .但是,我仍然可以使用localhost:1880/ui访问仪表板。

After this, I went to the settings.js and uncommented httpAdminRoot: '/flow' .之后,我转到settings.js并取消注释httpAdminRoot: '/flow' This changed the url to access the Flow Editor ( localhost:1880/flow ).这将 url 更改为访问 Flow Editor ( localhost:1880/flow )。 I also uncommented the ui: {path: "/"} which changed the url to access the Dashboard ( localhost:1880/ ).我还取消了ui: {path: "/"}的注释,它更改了 url 以访问仪表板 ( localhost:1880/ )。

Keeping the same URL Rewrite rules, I am still unable to access the dashboard with https://example.com but I am able to access the Flow Editor using https://example.com/flow .保持相同的 URL 重写规则,我仍然无法使用https://example.com访问仪表板,但我可以使用https://example.com/flow访问流程编辑器。

This is the error I get after trying to access https://example.com这是我在尝试访问https://example.com后得到的错误错误信息

Inbound/Outbound Rules入站/出站规则入境

出站

Any help would be appreciated thanks!任何帮助将不胜感激谢谢!

Try to make a test with the URL Rewrite rule below.尝试使用下面的 URL 重写规则进行测试。 It could help you rewrite example.com/ui to localhost:1880/ui .它可以帮助您将example.com/ui重写为localhost:1880/ui

 <rewrite>
            <rules>
                <rule name="test_rule" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="example.com" />
                        <add input="{REQUEST_URI}" pattern="^/ui$" />
                    </conditions>
                    <action type="Rewrite" url="http://localhost:1880/ui" />
                </rule>
            </rules>
  </rewrite>

Output: Output:

在此处输入图像描述

Further, you could modify the rule as per your own requirements.此外,您可以根据自己的要求修改规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM