SimuVedaSystem Design Lab Open in the lab

Edge and reliability / Intermediate / 9 min

API gateway with Nginx

Routing, TLS, JWT auth, rate limits, caching and failover, with a live nginx.conf you can copy.

Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.

In short

What it is
An API gateway is the single front door: it checks auth, applies rate limits, may cache, and routes each request to the right service.
Why it matters
Shared rules live in one place instead of being copied into every service.
The trade-off
It is a single point of failure and an extra hop, so it must be run as several copies and kept thin.
Say it in an interview
"The gateway handles auth, rate limiting and routing, so services only contain business logic."

Check yourself

Where is the TLS connection usually terminated in this setup?

Answer: At the gateway (Nginx). The gateway decrypts HTTPS once; internal hops can then use plain HTTP or their own mTLS.

What does Nginx’s auth_request do?

Answer: Asks an auth service to approve each request before proxying it. Requests without a valid token get 401 at the edge and never reach your services.

An upstream server crashes and proxy_next_upstream is on. What does the client see?

Answer: Usually a success, because Nginx retries on the other server. Nginx retries the failed request on another server in the upstream, hiding the failure.

See it happen in the simulation →

nginxreverse proxyjwtgateway

More in edge and reliability