Skip to content

Commit 1823133

Browse files
authored
Lab5 Updates (#27)
* lab5 updates --------- Signed-off-by: Shouvik <[email protected]>
1 parent eb251ed commit 1823133

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+424
-531
lines changed

labs/lab2/readme.md

+7-3

labs/lab4/readme.md

+6-3

labs/lab5/docker-compose.yml

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
# NGINX Plus Proxy with tools build
1+
# NGINX Plus Proxy with NGINX Agent
22
# NGINX webservers with ingress-demo pages
3-
# NGINX Basics, Nov 2024
3+
# NGINX Basics, Feb 2025
44
# Chris Akker, Shouvik Dutta, Adam Currier
55
#
66
services:
77
nginx-plus: # NGINX Plus Web / Load Balancer
8-
hostname: nginx-plus
9-
container_name: nginx-plus
10-
image: nginx-plus:workshop # From Lab1
11-
volumes: # Sync these folders to container
8+
environment:
9+
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
10+
NGINX_AGENT_SERVER_GRPCPORT: '443'
11+
NGINX_AGENT_TLS_ENABLE: 'true'
12+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey From One Console
13+
hostname: $NAME-nginx-plus
14+
container_name: $NAME-nginx-plus
15+
image: private-registry.nginx.com/nginx-plus/agent:nginx-plus-r32-alpine-3.20-20240613 # CVE - From Nginx Private Registry
16+
volumes: # Sync these folders to container
1217
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
1318
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
1419
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
1520
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
16-
links:
17-
- web1:web1
18-
- web2:web2
19-
- web3:web3
2021
ports:
2122
- 80:80 # Open for HTTP
2223
- 443:443 # Open for HTTPS
2324
- 9000:9000 # Open for API / dashboard page
24-
restart: always
25+
restart: always
26+
#
2527
web1:
26-
hostname: web1
27-
container_name: web1
28+
hostname: $NAME-web1
29+
container_name: $NAME-web1
2830
image: nginxinc/ingress-demo # Image from Docker Hub
2931
ports:
3032
- "80" # Open for HTTP
3133
- "443" # Open for HTTPS
3234
web2:
33-
hostname: web2
34-
container_name: web2
35+
hostname: $NAME-web2
36+
container_name: $NAME-web2
3537
image: nginxinc/ingress-demo
3638
ports:
3739
- "80"
3840
- "433"
3941
web3:
40-
hostname: web3
41-
container_name: web3
42+
hostname: $NAME-web3
43+
container_name: $NAME-web3
4244
image: nginxinc/ingress-demo
4345
ports:
4446
- "80"

labs/lab5/final/cafe.example.com.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# cafe.example.com HTTP
22
# NGINX Basics Workshop
3-
# Feb 2024, Chris Akker, Shouvik Dutta
3+
# Nov 2024, Chris Akker, Shouvik Dutta, Adam Currier
44
#
55
server {
66

77
listen 80; # Listening on port 80 on all IP addresses on this machine
88

99
server_name cafe.example.com; # Set hostname to match in request
1010

11-
# Uncomment the zone directive below to add metrics to the Dashboard
11+
# Uncomment the status_zone directive below to add metrics to the Dashboard
1212
status_zone cafe-VirtualServer;
1313

14-
# access_log /var/log/nginx/cafe.example.com.log main;
15-
access_log /var/log/nginx/cafe.example.com.log main_ext; Extended Logging
14+
access_log /var/log/nginx/cafe.example.com.log main;
15+
# access_log /var/log/nginx/cafe.example.com.log main_ext; Extended Logging
1616
error_log /var/log/nginx/cafe.example.com_error.log info;
1717

1818
location / {

labs/lab5/final/nginx.conf

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
user nginx;
3-
worker_processes 4; # Change to use 4 workers/cores
2+
worker_processes 1; # Change to use 4 workers/cores
43

54
error_log /var/log/nginx/error.log info;
65
pid /var/run/nginx.pid;
@@ -30,4 +29,4 @@ http {
3029
#gzip on;
3130

3231
include /etc/nginx/conf.d/*.conf;
33-
}
32+
}

labs/lab5/final/upstreams.conf

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
# NGINX Basics, OSS Proxy to three upstream NGINX web servers
2-
# Chris Akker, Shouvik Dutta - Feb 2024
1+
# NGINX Basics, Plus Proxy to three upstream NGINX containers
2+
# Nov 2024 - Chris Akker, Shouvik Dutta, Adam Currier
33
#
4-
# nginx-cafe servers
5-
upstream nginx_cafe {
4+
# nginx_cafe servers
5+
6+
upstream nginx_cafe { # Upstream block, the name is "nginx_cafe"
7+
8+
# Uncomment the zone directive below to add metrics to the Dashboard
9+
# zone nginx_cafe 256k;
610

711
# Load Balancing Algorithms supported by NGINX
812
# - Round Robin (Default if nothing specified)
913
# - Least Connections
1014
# - IP Hash
1115
# - Hash (Any generic Hash)
1216

13-
# Uncomment for Least Connections algorithm
14-
least_conn;
17+
# Uncomment for Least Time Last Byte algorithm
18+
# least_time last_byte;
1519

1620
# From Docker-Compose:
1721
server web1:80;
1822
server web2:80;
1923
server web3:80;
2024

21-
# Uncomment for IP Hash persistence
22-
# ip_hash;
25+
# Uncomment for Cookie persistence
26+
# sticky cookie srv_id expires=1m domain=.example.com path=/;
27+
2328

2429
# Uncomment for keepalive TCP connections to upstreams
25-
keepalive 16;
30+
# keepalive 16;
2631

2732
}
-159 KB
-146 KB
-101 KB
Binary file not shown.
-141 KB
Binary file not shown.
-294 KB
Binary file not shown.
-180 KB
Binary file not shown.
-75.4 KB
Binary file not shown.

labs/lab5/media/lab4_nginx-web1.png

-111 KB
Binary file not shown.

labs/lab5/media/lab4_nginx-web2.png

-109 KB
Binary file not shown.

labs/lab5/media/lab4_nginx-web3.png

-115 KB
Binary file not shown.
-196 KB
Binary file not shown.
67.9 KB
103 KB
253 KB
53.2 KB
43.8 KB
43.9 KB
42.2 KB
109 KB
69.9 KB
13.1 KB
173 KB
182 KB
105 KB
104 KB
105 KB
239 KB

labs/lab5/media/nginx-logo.png

-22.1 KB
Binary file not shown.

labs/lab5/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf

-31
This file was deleted.

labs/lab5/nginx-plus/etc/nginx/conf.d/upstreams.conf

-35
This file was deleted.

0 commit comments

Comments
 (0)