Preserve all header

Hi!
I’m new with Kong API… :slight_smile:

I have an API in a backend service “http://localhost:50001/backend” and this Backend’s API need to receive some header like “request-id”, “consumer” and “departament”.

I added a service in Kong, see below:
{
“host”: “localhost”,
“created_at”: 1562002805,
“connect_timeout”: 60000,
“id”: “9cc9cc4a-3b48-40e6-a938-a6b86f1aad0a”,
“protocol”: “http”,
“name”: “backend-service”,
“read_timeout”: 60000,
“port”: 50001,
“path”: “/backend”,
“updated_at”: 1562002805,
“retries”: 5,
“write_timeout”: 60000,
“tags”: null
}
And I added a route, see below:

{
“strip_path”: true,
“tags”: null,
“paths”: null,
“destinations”: null,
“protocols”: [
“http”,
“https”
],
“created_at”: 1562002281,
“snis”: null,
“hosts”: [
test.backend.kong.com
],
“name”: null,
“preserve_host”: false,
“regex_priority”: 0,
“id”: “c4544549-40ca-4eb1-a8e0-c72e475e1c4d”,
“sources”: null,
“updated_at”: 1562002281,
“https_redirect_status_code”: 426,
“service”: {
“id”: “9cc9cc4a-3b48-40e6-a938-a6b86f1aad0a”
},
“methods”: null
}

When I call my Kong API that I added, I don’t receive any request in my backend’s API.

Can you help me to understand this problem and solve that.

Hi,
Welcome to Kong Nation.
Could you detail how do you call you Kong API ? What is the response from kong ?

I noticed that you did not put any paths for your route. It means that if you call http://kong-proxy-ip:8000/anything with the header Host:test.backend.kong.com, it will forward the request to http://localhost:5001/backend/anything