Skip to content

EhabMagdyy/Nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

1. Nginx as Web Server

Files locations (in ubuntu)

# nginx.conf
/etc/nginx

# default
/etc/nginx/sites-enabled

# ehab.html
/var/www/html

Run in the browser

# <ipAddr>:Port
localhost:81

Output

Image


2. Nginx as ReverseProxy and Load Balancer

Files locations (in ubuntu)

# nginx.conf
/etc/nginx

# default
/etc/nginx/sites-enabled

# server.js -> anywhere

Run the project

Run the server

# Run server.js multiple times, for testing load balancing on multiple servers
node server.js 3001 &
node server.js 3002 &
node server.js 3003 &
node server.js 3004 &

request in the web browser

# <ipAddr>:Port
localhost:82

in this example, i'm using "least connection" in load balancing

output:

Image Image Image Image

Releases

No releases published

Packages

No packages published