Closed yaolucy007 closed 1 year ago
@yaolucy007 Mr. Terry,
First, Could you correct your English grammar mistakes please? It is hard to read your message.
Second, Could you attach Postman screenshots which show that mentioned endpoints are online, please, when you are using localhost deployments?
Third, Could you show Consul configs and show us that the endpoints are registered in Consul registry please?
Finally, Why do you use 16.0.1 version of May 25, 2020 release in May 2023? This release / version is quite outdated! Could you consider upgrading your Visual Studio solution and projects to .NET 7 targeting latest Ocelot 19.0.2 version please? NuGet: Ocelot 19.0.2
I've solved that problem. Through debugging I found that my service was returning cors errors when receiving requests for options, and after I adjusted the cross-domain policy of the service, everything worked fine.
Also, I was using an older version of the service because the project was running on netcore 3.1
I Use Ocelot 16.0.1 As ApiGateway with consul in my project. I have add 3 services to ocelot. if I test with postman,is works good.but if i request in axios.js,some errors make me sad. all of http interface is wokr except one.the request will retuan 404 status code in ocelot. Could you advice me?
my ocelot.json
my quest requst is:
http://192.168.0.110:50000/api/version/get?key=ROLE_254982093249970176
and this request will be forward tohttp://192.168.0.110:50004/api/version/get?key=ROLE_254982093249970176
this is the warning info in ocelot process console:
info: Ocelot.RateLimit.Middleware.ClientRateLimitMiddleware[0] requestId: 0HMQGVGK8B1C2:00000001, previousRequestId: no previous request id, message: EndpointRateLimiting is not enabled for /api/version/{action} info: Ocelot.Authentication.Middleware.AuthenticationMiddleware[0] requestId: 0HMQGVGK8B1C2:00000001, previousRequestId: no previous request id, message: No authentication needed for /api/version/get info: Ocelot.Authorisation.Middleware.AuthorisationMiddleware[0] requestId: 0HMQGVGK8B1C2:00000001, previousRequestId: no previous request id, message: /api/version/{action} route does not require user to be authorised warn: Ocelot.Requester.Middleware.HttpRequesterMiddleware[0] requestId: 0HMQGVGK8B1C2:00000001, previousRequestId: no previous request id, message: 404 (Not Found) status code, request uri: http://192.168.0.110:50004/api/version/get?key=ROLE_254982093249970176