- Clone this repository
git clone https://github.com/armandwipangestu/example-express-nginx-load-balancer
- Install PM2 Global
yarn global add pm2
- Install dependency express
cd example-express-nginx-load-balancer && yarn
- Start Express.js with
pm2
pm2 start
- Copy Nginx Config
cp nginx.conf <location of nginx config>
- Restart Nginx Service
nginx -s reload
- Trying hit api with
curl
andjq
NOTE: Try to hit or run this command more than one to see the effect. You can use another endpoint
/products
also
curl http://localhost:8081/users | jq '.'