我想要 IIS 10 将请求重定向到其他几个 Web 应用程序(ASP.NET Core 6.0 和 Angular 14)
假设我让 Kestrel 在 http://localhost:5009/ 上监听其中一个应用程序,我想输入
http://localhost/PassThrough/
进入浏览器地址并将其重定向到
http://localhost:5171/
还有
http://localhost/PassThrough/todo/param1
到
http://localhost:5171/todo/param1
IIS提供官方组件,URL重定向或反向代理都可以满足您的需求
获取 URL 重写模块: https://iis-umbraco.azurewebsites.net/downloads/microsoft/url-rewrite。 可以参考官方文档中的步骤来 创建重定向规则,从 http://localhost/App1/ 重定向到 http://localhost:5009/.
反向代理需要应用程序请求路由: https://iis-umbraco.azurewebsites.net/downloads/microsoft/application-request-routing.
URL重定向和反向代理的官方文档有详细的步骤和参考示例