> For the complete documentation index, see [llms.txt](https://www.mlcompendium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.mlcompendium.com/ai-engineering/full-stack-and-ops-1/api-gateway.md).

# API Gateway

Services need one front door, so clients do not have to know every service behind it. The page first says what an API gateway is, then shows how NGINX can be the web server, reverse proxy, load balancer, and gateway at once.

The starting question is [What is](http://web.archive.org/web/20230326030140/https://www.javatpoint.com/introduction-to-api-gateways) an API gateway? The archived javatpoint introduction answers it inside a microservices tutorial, next to topics such as load balancing and the Zuul gateway.

## NGINX

With the gateway named, the practical question is what to run it on, and NGINX already covers most of the roles. [NGINX](https://www.nginx.com/resources/glossary/nginx/) is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more. It started out as a web server designed for maximum performance and stability. In addition to its HTTP server capabilities, NGINX can also function as a proxy server for email (IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP, and UDP servers.

The term reverse proxy needs its own explanation, and Cloudflare on [what is a reverse proxy](https://www.cloudflare.com/learning/cdn/glossary/reverse-proxy/) is the proxy-servers explainer for it.

With both terms in hand, the NGINX blog makes the argument for not adding a separate product. From the NGINX blog:

> [One advantage of using NGINX as an API gateway](https://www.nginx.com/blog/deploying-nginx-plus-as-an-api-gateway-part-1/) is that it can perform that role while simultaneously acting as a reverse proxy, load balancer, and web server for existing HTTP traffic. If NGINX is already part of your application delivery stack then it is generally unnecessary to deploy a separate API gateway

## Deprecated links

{% hint style="warning" %}
These links and images no longer work. The original wording is kept here. A same-resource copy, when one was checked, is used above.
{% endhint %}

* what is. This address no longer opens: <https://www.javatpoint.com/introduction-to-api-gateways>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.mlcompendium.com/ai-engineering/full-stack-and-ops-1/api-gateway.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
