0

I have some apis, and a api-gateway in front of them. It happens to be Ocelot this is my configuration on my local environment:

  "ReRoutes": [
    {
      "DownstreamPathTemplate": "/{everything}",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 5000
        }
      ],
      "UpstreamPathTemplate": "/api1/{everything}",
      "UpstreamHttpMethod": [ "Get", "Post" ]
    },

the api is running as Kestrel. No docker. On the production system however it should be installed in IIS

The problem is this: on my locan environment all apis, nad the api gateway run on localhost, nad have a port. But on the server, they are installed as Websites, and Application inside the website. so if the website's address is xyz.com, api1's address is xyz.com/api1. and it is available. I don't want it to be available, only via the api gateway. The first quesrtion is, how to make in available only via the api gateway.

And the second issue is, it doesn't work. This is my configuration on the server:

  "ReRoutes": [
    {
      "DownstreamPathTemplate": "/Api1Api/{everything}",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost", <-- here I tried xyz.com too
          "Port": 80
        }
      ],
      "UpstreamPathTemplate": "/Api1/{everything}",
      "UpstreamHttpMethod": [ "Get", "Post" ]
    },

If I go to xyz.com/Api1Api it is working, but I don't want it to work, but if I go to xyz.com/ApiGateway/Api1, it is not working, but I want it to work from there

Mike Weber
  • 311
  • 2
  • 16
barii
  • 343
  • 1
  • 3
  • 12

0 Answers0