Questions tagged [ocelot]

Ocelot is a .NET API Gateway.

Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a micro services/service orientated architecture that need a unified point of entry into their system. However it will work with anything that speaks HTTP and run on any platform that ASP.NET Core supports.

In particular I want easy integration with IdentityServer reference and bearer tokens.

We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this.

Ocelot is a bunch of middlewares in a specific order.

Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is retrieved as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features!

Home repo

Documentations

273 questions
2
votes
1 answer

Adding Ocelot to web API breaks SignalR

I have a web API project where I use SignalR. Recently I added and configured Ocelot to be my gateway towards another web API. Ocelot routes the requests correctly but has messed up my SignalR configuration…
Alternatex
  • 1,505
  • 4
  • 24
  • 47
2
votes
1 answer

How to handle cors policy and preflight requests in Ocelot gateway?

I have an Ocelot gateway that routes and handles my API server request. The problem is that I use CORS Policy in APIs, when a request comes from the web browser to APIs and I need to get preflight request and route to the specific API. Now I can't…
Majid Gholipour
  • 179
  • 1
  • 11
2
votes
1 answer

gateway ocelot API doesn't work .NET 6 ASP.NET C#

I'm creating a project with microservices and now I want to be able to test the API gateway with ocelot API every time I try to access https://localhost:4482/gateway/product give me "can't reach this page" ocelot.json: { "ReRoutes": [ { …
ha33
  • 162
  • 1
  • 5
  • 16
2
votes
1 answer

.Net 6 Ocelot 18.0.0 returns Error 404 when navigating to an URL of the gateway

I have two API's. One of them is a Gateway (Ocelot + .Net 6) and the other one is a normal .Net 6 API, which I'm gonna call Backoffice. On both of them I have a controller with and endpoint 'api/health' that indicates if the API is running and…
Joel Vicente
  • 46
  • 1
  • 6
2
votes
0 answers

ASP.NET Core 5 - Force Ocelot Routing to use URL Encoding

I have a little issue with Ocelot Gateway v17. I'm using URL Encoding to pass some parameter to controller. Like this: https://localhost:44350/api/analytics/alarms/RD-A-001%2F1/1 Testing in my laptop, works fine, but in the server (IIS), Ocelot…
2
votes
1 answer

Request IP address via docker

Currently, I'm using docker-compose to build my microservices. Every request that comes to API needs to go through the gateway service using Ocelot. In the gateway service, I have configured to restrict the number of requests. The documentation said…
TrungPhan
  • 21
  • 2
2
votes
3 answers

API Gateway Ocelot and Kubernetes

I am trying to access my microservice "externalforum-api-svc" inside my kubernetes cluster using ocelot gateway. I`ve followed the docs but it does not seem to be working. Can someone please tell me whats wrong with it? I want to deploy the ocelot…
2
votes
3 answers

Ocelot API Gateway error: No connection could be made because the target machine actively refused it

I am trying to build a microservice architecture system using Ocelot as my API Gateway. I have had the current problem for about 2 weeks and have not been able to figure out why it is happening, so I am turing to the experts and hopefully you can…
LydsE
  • 21
  • 1
  • 4
2
votes
1 answer

Generate api and models in TS with openapi-generator-cli from multiple definitions from ocelote

I'm trying to setup a dotnet micro-service backend with a gateway using Ocelote. Doing this as described, Ocelote provides me with multiple swagger definitions (for each micro-service) Since the API now has multiple definition, each definition has…
Deitsch
  • 1,610
  • 14
  • 28
2
votes
0 answers

Ocelot DownstreamHostAndPorts for IIS virtual directory on same server using localhost as the host

I have been trying to configure ocelot on IIS with virtual directories and do not understand why the DownstreamHostAndPorts.Host value does not work when the value is localhost. As you can see from the configuration below the gateway sits at…
jmzagorski
  • 1,135
  • 18
  • 42
2
votes
0 answers

Using Nginx and Ocelot Api together

I want to publish my net core application in my docker-compose file on Ubuntu. Would it be unreasonable to use Nginx for SSL forwarding and Ocelot api for api gateway together ? Thank you very much in advance.
2
votes
1 answer

How post json body in ocelot.json route asp.net core

{ "DownstreamPathTemplate": "/ProceedToBuy/PostWishList", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 8003 } ], "UpstreamPathTemplate":…
Aman Gupta
  • 41
  • 7
2
votes
1 answer

Ocelot Proxy AddJsonFile reloadOnChange is not working on azure linux app service

I am working with Ocelot proxy, I have a problem with reloadOnChange on azure linux app service. When changing the json configuration, they are not reflected until restarting the app service. It working fine locally and when trying it on an azure…
Ghyath Serhal
  • 7,466
  • 6
  • 44
  • 60
2
votes
2 answers

Ocelot Rate Limiting

I've been using Ocelot lately to build an API Gateway. Are rate limits based on the requester client id? Because i've been asked to build an api gateway in an architecture that will look like this And all the requests will have the same id since…
Baz
  • 143
  • 3
  • 9
2
votes
1 answer

How to add authorization (Authorize button) in swagger for ocelot

How can I add Authorize button in swagger, when I have ocelot api gateway? I configure my service collection like that: s.AddSwaggerForOcelot(configuration); s.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "ApiGateway"…
godot
  • 3,422
  • 6
  • 25
  • 42