https://github.com/ehabmagdyy/nginx
Nginx Examples in linux
https://github.com/ehabmagdyy/nginx
nginx nginx-load-balancer nginx-reverseproxy nginx-webserver
Last synced: 4 months ago
JSON representation
Nginx Examples in linux
- Host: GitHub
- URL: https://github.com/ehabmagdyy/nginx
- Owner: EhabMagdyy
- Created: 2025-02-15T06:04:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-18T06:15:18.000Z (over 1 year ago)
- Last Synced: 2025-08-22T05:21:10.779Z (10 months ago)
- Topics: nginx, nginx-load-balancer, nginx-reverseproxy, nginx-webserver
- Language: HTML
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 1. Nginx as Web Server
### Files locations (in ubuntu)
```bash
# nginx.conf
/etc/nginx
# default
/etc/nginx/sites-enabled
# ehab.html
/var/www/html
```
### Run in the browser
```bash
# :Port
localhost:81
```
#### Output
> 
---
## 2. Nginx as ReverseProxy and Load Balancer
### Files locations (in ubuntu)
```bash
# nginx.conf
/etc/nginx
# default
/etc/nginx/sites-enabled
# server.js -> anywhere
```
### Run the project
> #### Run the server
```bash
# 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
```bash
# :Port
localhost:82
```
#### in this example, i'm using "least connection" in load balancing
> #### output:
> 
> 
> 
> 