1- Docker Proxy behind a firewall pointing to my API on my local network.
2- Configured the API’s target url on tyk cloud to point to my local API.
3- Published the API on the portal and received an API key.
When I try to consume the API, I’m getting 404 Not found error.
Is there a way to see a log on the docker proxy of incoming and outgoing requests (I’m trying to figure out where my problem is)?
Ok, so there’s the issue - the 404 is coming from the gateway, and it’s because the URL is wrong.
Tyk Hybrid containers do not use the api-slug, they are pretty raw, so you need to use the API ID to route to the API, and you need to target the gateway directly:
You can find the API ID in the API list in your cloud dashboard.
If you want to use port 80, or use NGinX, then you’ll need to do some more work, Tyk Docker Hybrids have nginx installed, but require manual configuration to respect domain names, you can see here:
That the container mounts a confs folder into the sites-enabled folder of Nginx in the container, you can use this to put an Tyk NGinX configuration in place to handle domains.
However, I’d start off with targeting the API directly over the gateway on port 8080 and the APIID.
That error means that the Authorization header is not in the request that gets to the gateway, so tyk cannot find the header when the request lands, and is telling you so.
that’s all there is to it, are you sure you have added the header to the request properly, does it work with Curl? Postman?
This is a little trickier, now the Tyk Hybrid container runs nginx, and you can basically write your own URL rewrite rules for the hybrid. See here:
The local confs directory gets mounted into the docker nginx sites-enabled folder. You you can just include a domain.tconf or domain.conf file in there that hanles your domain routing inside the container to rewrite your api-slug to the API ID.
The portal is hosted in Tyk Cloud, not the hybrid, so you’ll need to use your cloud domain, or upgrade your account to a startup plan so we can give you a custom CNAME.
That error means that you have a duplicate server name configured in NginX, do you have multiple nginx configurations you are mounting? When the docker image starts, the whole confs directory is mounted, so any other files in there might also being interpreted by NginX.