如何避免 ocelot 中下游 url 中的端口?

Pin*_*tra 5 c# heroku ocelot

端口已添加到下游 url。我想访问 Heroku 中托管的微服务。需要避开港口。请帮忙。

它在本地开发环境中工作。但在 Heroku 中部署后不起作用。

{
  "ReRoutes": [
    {
      "DownstreamPathTemplate": "/api/{catchAll}",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "catalogapi-pinaki.herokuapp.com"
        }
      ],
      "UpstreamPathTemplate": "/cat-logApi/{catchAll}"

    }

  ],
  "GlobalConfiguration": {
    "BaseUrl": "http://localhost"
  }
}
Run Code Online (Sandbox Code Playgroud)

下游 URL 应为“ https://catalogapi-pinaki.herokuapp.com/api/CatalogApi/GetAllItems ”。

错误:消息:下游网址为https://catalogapi-pinaki.herokuapp.com:56084/api/CatalogApi/GetAllItems

我的错误消息

dee*_*ute 2

您是否尝试强制使用默认端口?您可以使用“DownstreamHostAndPorts”内的端口属性指定端口,如下所示:

     {
        "ReRoutes": [
            {
            "DownstreamPathTemplate": "/api/{catchAll}",
            "DownstreamScheme": "https",
            "DownstreamHostAndPorts": [
                {
                    "Host": "catalogapi-pinaki.herokuapp.com",
                    "Port": 443
                }
            ],
            "UpstreamPathTemplate": "/cat-logApi/{catchAll}"
            }
        ],
        "GlobalConfiguration": {
            "BaseUrl": "http://localhost"
        }
    }
Run Code Online (Sandbox Code Playgroud)