Skip to content

Dynamic Routing Error: Using dynamic routing with services that use HTTP and HTTPS #2253

Description

@viktoralfa19

Please I have a simple .Net 8 web api application where Ocelot version 23.2.2 is used and I have this configuration. I am also using CONSUL as service discovery.
When running in a container with docker-compose and trying to use dynamic routing I want to use internal APIs with HTTP and external APIs with HTTPS so I configure OCELOT like this:

{
  "Routes": [],
  "DynamicRoutes": [
    {
      "ServiceName": "openloyalti",
      "UseServiceDiscovery": true
    }
  ],
  "GlobalConfiguration": {
    "ServiceDiscoveryProvider": {
      "RequestIdKey": "OcRequestId",
      "Scheme": "http",
      "Host": "consul-server",
      "Port": 8500,
      "Type": "Consul"
    },
    "RateLimitOptions": {
      "ClientWhitelist": [],
      "EnableRateLimiting": false,
      "HttpStatusCode": 429,
      "QuotaExceededMessage": "Too many requests, please try again later."
    },
    "LoadBalancerOptions": {
      "Type": "LeastConnection"
    },
    "HttpHandlerOptions": {
      "UseTracing": true
    },
    "DownstreamScheme": "http"
  }
}

When doing so I always get this exception:

Image

Basically I want to know how to solve my problem of using dynamic routing with services that use HTTP and other services that use HTTPS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsulService discovery by ConsulRoutingOcelot feature: RoutingService DiscoveryOcelot feature: Service Discoveryhelp wantedNot actively being worked on. If you plan to contribute, please drop a note.medium effortLikely a few days of development effortproposalProposal for a new functionality in Ocelot

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions