Trailing slash of target URL is missing


I created an API and found out that tyk forgets the trailing slash of target url.

Working example:
Target URL:
Request URL:
The path in “Log Browser” is: Path: /API/XYZ/2017-11-15
→ the trailing slash is missing, but request works fine

Not working example:
Target URL:
Request URL:
The path in “Log Browser” is: Path: /API
→ does not work. Status Code 301.
It seems so that the rewrite rule at the endpoint cannot be reached (but I’m not sure)

Although I have specified a slash at the end of the path, this slash is “forgotten” in the request.

When I make requests to endpoint in browser or in Postman like this:   (without the trailing slash)

Then I get a fine response.

But when I make a request on tyk URL:

then I get following errors:

  • Firefox Browser: no errors
  • cURL: 301 - Moved permanently
  • Postman: 401 - Unauthorized
  • tyk Error Log: 301

Please note that tyk error log, cURL and Postman show different error codes.

This is a drawback in Tyk Cloud due to how we have to handle API and Org routing. Thi doesn;t happen in Hybrid or on-prem.

O.K. - I was now able to catch this error with a RewriteRule at endpoint.

Hello I have noticed this very same problem when upgrading to gateway version 2.4.1 on premises whereas it was working fine with gateway version 2.3.7

I guess this is not related to tyk cloud at all, but affects all new versions of the gateway.

Could anyone confirm ?

It seems fixed with v2.4.1

Actually, it is not fixed at all with v2.4.1. I Though it was because we rolled back gateways to v2.3.7…
This bug is both strange and very annoying.

Can anyone reproduce it ?

@jmleoni Can you provide an example of what isn’t working?

Hi I have the same problem
my config:
“proxy”: {
“listen_path”: “/v2/applications/”,
“target_url”: “”,
“strip_listen_path”: true
when my client(postman) send
the server gets :

WITHOUT the trailing slash of target url

same config works on v2.3.13 but NOT working in v2.4.0 and up


301, “Moved Permanently”

The HTTP response status code 301 Moved Permanently is used for permanent URL redirection, meaning current links or records using the URL that the response is received for should be updated. The 301 response from the Web server should always include an alternative URL to which redirection should occur. If it does, a Web browser will immediately retry the alternative URL. This is the best way to ensure that users and search engines are directed to the correct page. The 301 status code means that a page has permanently moved to a new location.