Configuration of Tyk when having many sites running in the server

Hello, I am going to set up Tyk on Promises in my Server. I have some questions to be sure that it will work as intended. The thing is that I have many applications running on differents ports of my server and I have asigned a Domain for each of them, and I use Caddy Server to proxy between them, until now it’s working great. I have something like this:

Application1 running on port 7000 -> theapplicationX.com
Application2 running on port 8000 -> theapplicationY.com
Application2 running on port 8100 -> theapplicationZ.com
MyRestAPI running on port 8200 -> MyRestAPI.com

I want to monitor MyRestAPI with Tyk, that’s the idea. Briefly all the traffic is received by port 80 and 443 and depending of the domain name Caddy send the petition to the correspondant application. Now, these are my questions:

  1. I know that I have to install Tyk Gateway and Tyk Dashboard, do I need to assign a domain for each one of them? and register them in Caddy?
  2. I saw in the installation instructions of Tyk Gateway that I have to provide --listenport=8080 in the documentation says that it is: “Tyk should listen on port 8080 for API traffic.” So, here should I put 8200 instead 8080 because my API is running in that port? if not, then how Tyk check for petitions of my API?
  3. Can be a problem to have applications that I will not monitorize running in the same server?
  4. When I finish install and configure Tyk, I should use my API with MyRestAPI.com ?

I think that’s all for now, I just want to be sure that my current server configuration will not give me problems. Thank you!

The dashboard works best with a hostname instead of an IP, the gateway doesn’t care, so no domain needed unless you want to expose the gateway publicly.

No, the gateway is a proxy, so the requests will be going from Caddy → Tyk → Application, i.e.:

MyRestAPI running on port 8200 -> Tyk (8080) -> MyRestAPI.com (80)

It should be ok so long as your traffic is low, it really depends on your traffic levels. Tyk needs redis and MongoDB, Redis can eat a lot of RAM because it stores all data in memory, and MongoDB (if your data set becomes very large), will want a lot of RAM to perform well (e.g. run aggregation pipelines across the raw log set instead of the aggregate log set).

Yes, but you’ll need to make sure that Caddy is sending on the host header when it proxies to Tyk, and In Tyk you want to set the REST API to be on a custom domain (MyRestAPI.com) with a listen path set to root (/), this way when the request comes from Caddy, Tyk will know what to listen for.