krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.
https://www.krakend.io
Apache License 2.0
1.98k stars 452 forks source link

How to configure KrakenD to NOT follow redirect #378

Closed mango009 closed 2 years ago

mango009 commented 2 years ago

Hi, How do I configure KrakenD such that it would not follow redirect 3xx from the endpoints? I tried to configure both the "output-encoding" for the endpoint with "no-op" and backend "encoding" with "no-op" as described in the doc (https://www.krakend.io/docs/endpoints/no-op/). But KrakenD still follows redirect.

Here's the configuration of my endpoint:

    {
      "endpoint": "/look/away",
      "output_encoding": "no-op",
      "backend": [
        {
          "encoding": "no-op",
          "url_pattern": "/look/away",
          "host": [
            "http://{{env "REST_API"}}"
          ]
        }
      ]
    },
kpacha commented 2 years ago

the internal http clients will always follow the redirect. if you want to pass it, you can use the redirect plugin available at the enterprise version (https://www.krakend.io/docs/enterprise/backends/client-redirect/)

cheers!

github-actions[bot] commented 2 years ago

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.