node01 and node02) at port 5000. Incoming HTTP requests hit NGINX, which forwards them to healthy backends—improving scalability and fault tolerance.

Lab Environment
Below is the topology for this demo:| Host | Role | IP Address |
|---|---|---|
nginx | Reverse proxy server (NGINX) | 192.230.206.12 |
node01 | Flask application (port 5000) | 192.230.206.3 |
node02 | Flask application (port 5000) | 192.230.206.6 |

SSH into the Backends
From thenginx host, connect to each Flask server:
Step 1: Verify Backend Servers
On node01:Step 2: Configure Firewall Rules
Ensure only the NGINX proxy can reach port 5000 on your Flask servers, while keeping SSH open for management.If UFW is already enabled, skip
sudo ufw enable and proceed with rule creation.Step 3: Configure NGINX as a Reverse Proxy
-
Remove the default site and switch to the config directory:
-
Create
/etc/nginx/sites-available/helloworldwith upstream and server blocks: -
Enable the site and reload NGINX:
Step 4: Test the Reverse Proxy
Usecurl with a custom Host header to emulate requests to helloworld.com:
Step 5: Simulate a Backend Failure
Comment out one server in theupstream block to test NGINX’s resilience:
Ensure that
helloworld.com resolves to your NGINX server IP (192.230.206.12) in DNS or /etc/hosts before testing.You’ve now configured NGINX as a robust reverse proxy and simple load balancer for your Flask applications. Next, explore advanced proxy settings, SSL termination, and health checks in the NGINX documentation.