Ocelot总是以5000端口启动

发布于 2025-01-18 08:53:56 字数 597 浏览 3 评论 0原文

我正在尝试部署我的Ocelot网关服务器。

我键入useUrls(“ http:// localhost:6000”),看到了使用6000端口的服务器。为了尝试更改端口,在删除 useUrls 语法之后,我像以下一样修改了 ocelot.json 文件

  "GlobalConfiguration": {
    "BaseUrl": "http://localhost:6000"
  }

,但是我的服务器再次使用5000端口启动。

首先,我想JSON文件中存在一些错误。因此,我在同一JSON文件中修改了一个重新路由API。但是效果很好。也就是说,JSON文件运行良好。

其次,我将 globalconfiguration 移至文件的顶部,但它也不正常。但是重新打扰效果很好。

另外,我也尝试在下面

appsettings.json

"urls" : "http://localhost:6000"

这也不起作用。

有人可以帮我吗?提前致谢。

I'm trying to deploy my ocelot gateway server.

I had typed UseUrls("http://localhost:6000") and I saw the server launched with 6000 port. In order to I tried to change port, after delete UseUrls syntax, I modified ocelot.json file like below

  "GlobalConfiguration": {
    "BaseUrl": "http://localhost:6000"
  }

However, my server launched with 5000 port again.

First, I guess there were some error in json file .So I modified a rerouting APIs in same json file. But It worked well. That is, json file is working well.

Second, I moved GlobalConfiguration to top of the file and It didn't work as well. But rerouting worked well.

Also I tried to below also

appsettings.json

"urls" : "http://localhost:6000"

This didn't work either.

Is there anyone to help me please? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦情居士 2025-01-25 08:53:56

我使用以下JSON(JSON文件中的 kestral 键)解决了这个问题。我猜这不是一个适当的解决方案,而是对于其他情况的其他人:

"Kestrel": {
    "EndPoints": {
      "Http": {
        "Url": "http://localhost:6000"
      }
    }
  },

I solved this problem using the below JSON (Kestral key in JSON file). I guess it is not a proper solution, but for other people who are in the same situation:

"Kestrel": {
    "EndPoints": {
      "Http": {
        "Url": "http://localhost:6000"
      }
    }
  },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文