Nginx Introduction and Uses

What is a Proxy?

A proxy is an intermediary that acts on behalf of another system. In networking, it sits between a client and a destination server.

Everyday Example

If your college network blocks a website and you use a VPN, your request first goes to the VPN server. That server then forwards the request to the target website.
This is an example of a forward proxy.

What is a Reverse Proxy?

A reverse proxy sits in front of your application servers and receives requests from users before forwarding them to backend services.

It is commonly used for:

  • Routing traffic
  • Security controls
  • Load balancing
  • Better performance and caching

Simple Example

Suppose a single machine runs two apps:

  • web1.com on port 3000
  • web2.com on port 4000

Instead of exposing ports publicly (web1.com:3000, web2.com:4000), Nginx can map clean domains to each backend service.

Reverse Proxy Setup with Nginx

1) Install Nginx

2) Configure Routing Rules

Open your Nginx config:

Minimal example:

3) Restart Nginx


Nginx reverse proxy flow diagram from clients to backend servers

With this setup, users access clean URLs while Nginx handles backend routing behind the scenes.

Read more in the official docs: Nginx Documentation.