Host header not being set by Modified Headers Plugin


#1

In Endpoint Designer I have an endpoint with two plugins enabled: Modified Headers and URL Rewrite.

In Modified Headers I have configured a new Request header to be added.

And in URL Rewrite I have a pattern to match and what to rewrite it to.

The issue I’m having is that Tyk is not setting the Host header as part of the request and this is causing problems.

I have tried the request without going through Tyk and it works as expected but through Tyk it doesn’t.

I tried setting proxy.preserve_host_header to true - which works only if the client where the calls originates from sets the Host header (which is not what I need)


#2

Any thoughts on this?


#3

The Host header will most likely be rewritten once Tyk starts the proxy to the target URL of the API Definition. If you need to change the target of the request to a different URL you could do this in the URL Rewrite directly (it gets triggered by adding a fully-qualified URL instead of just a path).