Search code examples
asp.net-coreapi-gatewayocelot

ocelot always launch with port 5000


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.


Solution

  • 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"
          }
        }
      },