1. Nginx as Reverse Proxy

Nginx sits in front of your Node.js/MERN app. It handles SSL, load balancing, and passes requests to your backend.

$ sudo apt install nginx

Install Nginx on Ubuntu

$ nginx -t

Test Nginx configuration for syntax errors

$ sudo systemctl restart nginx

Apply new configuration changes