ThreeMammals/Ocelot

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

Open

#2 253 ouverte le 18 janv. 2025

Voir sur GitHub
 (12 commentaires) (0 réactions) (0 assignés)C# (1 617 forks)batch import
ConsulRoutingService Discoveryhelp wantedmedium effortproposal

Métriques du dépôt

Stars
 (8 137 stars)
Métriques de merge PR
 (Merge moyen 10j 13h) (4 PRs mergées en 30 j)

Description

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:

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.

Guide contributeur