ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.38k stars 1.64k forks source link

Gateway showing ERR_UNEXPECTED_PROXY_AUTH error on brower / 407 (Proxy Authentication Required) status code #1800

Closed ChetanGhodke007 closed 11 months ago

ChetanGhodke007 commented 11 months ago

Expected Behavior / New Feature

Gateway should return response from downstream api path

Actual Behavior / Motivation for New Feature

We have hosted 2 application on IIS (windows server), first downstream app opens on 1008 and ocelot gateway app opens on 1009 port. when called gateway upstream api url then gives error.

Steps to Reproduce the Problem

  1. Create ocelot gateway app with following configuration

    {
    "Routes": [
    {
      "DownstreamPathTemplate": "/api/values",
      "DownstreamScheme": "http",
      "DownstreamHttpMethod": "GET",
      "RouteIsCaseSensitive": false,
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 1008
        }
      ],
      "UpstreamPathTemplate": "/gateway/values",
      "UpstreamHttpMethod": [ "GET" ]
    }
    ],
    
    "GlobalConfiguration": {
    "BaseUrl": "http://localhost:1009/"
    
    }
    }
    1. create simple api with get method.
    2. call gateway url using http://localhost:1009/gateway/values

While checking windows application logs below error logged:

Category: Ocelot.Requester.Middleware.HttpRequesterMiddleware EventId: 0 SpanId: bc5b99469ceadbf8 TraceId: dfe677d0d8dfb6548b6865513454e2db ParentId: 0000000000000000 RequestId: 80000040-0004-f600-b63f-84710c7967bb RequestPath: /gateway/values

requestId: 80000040-0004-f600-b63f-84710c7967bb, previousRequestId: no previous request id, message: 407 (Proxy Authentication Required) status code, request uri: http://localhost:1008/api/values

Specifications

raman-m commented 11 months ago

Welcome to Ocelot world! 🐯

Why is your GitHub profile empty? Are you a student?

Please, fork Ocelot repository!... to be able to debug solution and contribute, if you have an intention to contribute, for sure

raman-m commented 11 months ago

Chetan, I don't see any issue in Ocelot. Going to convert this to a discussion thread...