在 k8s 集群中,我们有一个 ASP.NET Core 6 MVC Web 应用程序。如果我使用 NGINX 入口类配置入口控制器 -> 使用请求主机和路径前缀 / ,目标服务集群 IP 端口 443 都可以正常工作。
如果我想使用 Kong 入口类 -> 前缀 /onename,目标服务集群 IP 端口 443,剥离路径 true 并将主机保留为 false。我明白了
{
"message": "An invalid response was received from the upstream server"
}
ASP.NET Core MVC Web 应用程序具有基本路径
/
。
如何使用 Kong 入口类配置入口控制器?
我想导航,例如: https://res0ingresskong.resources.root.gc.local/onename
路由到集群上我的 ASP.NET Core MVC 应用程序的 /
我想导航,例如:https://res0ingresskong.resources.root.gc.local/onename
前缀 /onename,目标服务集群 IP 端口 443,剥离路径 true 并将主机保留为 false。
在您当前的配置下,Kong 将接受路径
/onename
的请求,剥离它,并将 /
请求发送到您的 .NET 应用程序。false
来自文档的参考:
strip_path
:When matching a Route via one of the paths, strip the matching prefix from the upstream request URL. Default: true.