Nginx is a high-performing web server and load balancer. It is well suited for deploying high-traffic websites and API servers. Even though this decision is opinionated, it is a community-driven, industry-strong web server. It is similar to the Apache2 web server.
Nginx can also act as a reverse proxy server that allows us to redirect our HTTP requests to multiple application servers running on the same network. The main contender of Nginx is Apache's httpd. Nginx is an excellent static file server that can be used by web clients. Since we are dealing with APIs, we will take a look at how to deal with HTTP requests.
We can access Nginx in two ways:
- Installation on a bare machine
- Using a preinstalled Docker container
Let's understand both in more detail.