News KrakenD 3.0 Is Here: AI Router, Semantic Cache, and On-the-Fly Stream Manipulation News KrakenD CE 3.0.4, EE 3.0.4 and EE 2.13.14 Update Released News What Is an AI Gateway? Architecture, Controls and Use Cases News KrakenD CE 3.0.3, EE 3.0.3 and EE 2.13.13 Update Released

You are viewing a previous version of KrakenD Enterprise Edition (v2.2), go to the latest version KrakenD Enterprise 2.x receives security patches only until its end of life on April 5, 2027.

Document updated on

Client redirects

Starting from version v2.3, this component is no longer being developed and has been marked as deprecated. As a result, it will not receive any updates and will be removed in future releases. It has been replaced by backend/http/client, check the latest documentation.

When a backend returns a redirect, the default behaviour of KrakenD is to follow the redirection and serve the final content to the user. When this behaviour needs to be prevented and let the end-client follow the redirect itself, then you need to enable the no-redirect plugin.

Client redirect configuration

You can stop KrakenD from following redirections like a 301 with the following configuration, highlighting relevant sections:

{
    "version": 3,
    "plugin": {
        "pattern": ".so",
        "folder": "/opt/krakend/plugins/"
    },
    "endpoints": [
        {
            "endpoint": "/redirect",
            "output_encoding": "no-op",
            "backend": [
                {
                    "url_pattern": "/__debug",
                    "encoding": "no-op",
                    "extra_config": {
                        "plugin/http-client": {
                            "name": "no-redirect"
                        }
                    }
                }
            ]
        }
    ]
}

Important: The only encoding you can use is no-op for both the output_encoding of the endpoint and the encoding of the backend.

There is no additional configuration other than enabling the plugin needed.

Unresolved issues?

The documentation is only a piece of the help you can get! Whether you are looking for Open Source or Enterprise support, see more support channels that can help you.

See all support channels