Skip to content

Commit ebdf8b5

Browse files
authored
Plus Labs1-3 Initial (#20)
* initial Plus lab * lab1 changes * split into OSS & Plus folders * rename nginx-oss to nginx-plus * lab1-2 rewrites * lab1-2 Plus initial draft * lab3 Plus initial draft * main README update and new diagram * fixed typos
1 parent 9ea4fca commit ebdf8b5

File tree

365 files changed

+14713
-54
lines changed

Some content is hidden

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

365 files changed

+14713
-54
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Don't track these files
22
*.crt
33
*.key
4+
*.jwt
45
.DS_Store
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

labs/lab0/prerequisites.md renamed to OSS/labs/lab0/prerequisites.md

Lines changed: 2 additions & 2 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
139 KB
142 KB

Plus/labs/lab0/media/F5signup.png

130 KB

Plus/labs/lab0/media/almostthere.png

370 KB

Plus/labs/lab0/media/courselist.png

136 KB

Plus/labs/lab0/media/domaincreds.png

18.7 KB
26.8 KB

Plus/labs/lab0/media/joinbutton.png

207 KB

Plus/labs/lab0/media/launchrdp.png

290 KB
79.3 KB
127 KB

Plus/labs/lab0/media/useruser.png

138 KB

Plus/labs/lab0/media/waitforboot.png

200 KB

Plus/labs/lab0/prerequisites.md

Lines changed: 87 additions & 0 deletions

Plus/labs/lab0/readme.md

Lines changed: 101 additions & 0 deletions

Plus/labs/lab1/docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# NGINX Plus with tools build
2+
# NGINX Plus Basics, Nov 2024
3+
# Chris Akker, Shouvik Dutta, Adam Currier
4+
#
5+
services:
6+
nginx-plus: # NGINX Plus Web / Load Balancer
7+
hostname: nginx-plus
8+
container_name: nginx-plus
9+
build: ./nginx-plus # Build new container, using /nginx-plus/Dockerfile
10+
image: nginx-plus:workshop
11+
volumes:
12+
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d # Copy these folders to container
13+
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
14+
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
15+
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
16+
ports:
17+
- 80:80 # Open for HTTP
18+
- 443:443 # Open for HTTPS
19+
- 9000:9000 # Open for Plus Dashboard page / API
20+
restart: always

Plus/labs/lab1/final/dashboard.conf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# NGINX Plus Basics, Nov 2024
2+
# Chris Akker, Shouvik Dutta, Adam Currier
3+
# dashboard.conf
4+
#
5+
server {
6+
# Conventional port for the NGINX Plus API is 8080
7+
listen 9000;
8+
access_log off; # reduce noise in access logs
9+
10+
# Conventional location for accessing the NGINX Plus API
11+
location /api/ {
12+
# Enable in read-write mode
13+
api write=on;
14+
}
15+
16+
# Conventional location of the NGINX Plus dashboard
17+
location = /dashboard.html {
18+
root /usr/share/nginx/html;
19+
}
20+
21+
# Redirect requests for "/" to "/dashboard.html"
22+
location / {
23+
return 301 /dashboard.html;
24+
}
25+
}

Plus/labs/lab1/final/default.conf

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# NGINX Plus Basics, Nov 2024
2+
# Chris Akker, Shouvik Dutta, Adam Currier
3+
# default.conf
4+
#
5+
server {
6+
listen 80;
7+
server_name localhost;
8+
9+
#charset koi8-r;
10+
#access_log /var/log/nginx/host.access.log main;
11+
12+
location / {
13+
root /usr/share/nginx/html;
14+
index index.html index.htm;
15+
}
16+
17+
#error_page 404 /404.html;
18+
19+
# intercept server error pages to the static page /50x.html
20+
#
21+
error_page 500 502 503 504 /50x.html;
22+
location = /50x.html {
23+
root /usr/share/nginx/html;
24+
}
25+
26+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
27+
#
28+
#location ~ \.php$ {
29+
# proxy_pass http://127.0.0.1;
30+
#}
31+
32+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
33+
#
34+
#location ~ \.php$ {
35+
# root html;
36+
# fastcgi_pass 127.0.0.1:9000;
37+
# fastcgi_index index.php;
38+
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
39+
# include fastcgi_params;
40+
#}
41+
42+
# deny access to .htaccess files, if Apache's document root
43+
# concurs with nginx's one
44+
#
45+
#location ~ /\.ht {
46+
# deny all;
47+
#}
48+
}
49+

Plus/labs/lab1/media/docker-icon.png

15.2 KB

Plus/labs/lab1/media/github-icon.png

7.08 KB
84.5 KB
74 KB

Plus/labs/lab1/media/nginx-icon.png

9.2 KB

Plus/labs/lab1/media/nginx-logo.png

22.1 KB
27.2 KB

Plus/labs/lab1/media/nginx-tshirt.png

330 KB

Plus/labs/lab1/media/vs-code-icon.png

4.8 KB

Plus/labs/lab1/nginx-plus/Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# For Ubuntu 20.04:
2+
FROM ubuntu:focal
3+
4+
## Install Nginx Plus
5+
# Download certificate and key from the MyF5 customer portal (https://account.f5.com/myf5)
6+
# and copy to the build context and set correct permissions
7+
RUN mkdir -p /etc/ssl/nginx
8+
COPY etc/ssl/nginx/nginx-repo.* /etc/ssl/nginx/
9+
RUN chmod 644 /etc/ssl/nginx/*
10+
11+
# Install prerequisite packages:
12+
RUN apt-get update && apt-get install -y apt-transport-https lsb-release ca-certificates curl wget gnupg2 net-tools vim tree openssl jq
13+
14+
# Download and add the NGINX signing key:
15+
RUN wget https://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key
16+
17+
# Add NGINX Plus repository:
18+
RUN printf "deb https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n" | tee /etc/apt/sources.list.d/nginx-plus.list
19+
20+
# Download the apt configuration to `/etc/apt/apt.conf.d`:
21+
RUN wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
22+
23+
# <TODO: modify apt-get install command to pull R32 ( no R33 allowed ):
24+
# HELP: https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-docker/#creating-custom-nginx-plus-docker-image
25+
# Update the repository and install version R32P1 of NGINX Plus:
26+
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y nginx-plus=32-2*
27+
28+
# Remove nginx repository key/cert from docker
29+
RUN rm -rf /etc/ssl/nginx \
30+
# Remove default nginx config
31+
# && rm /etc/nginx/conf.d/default.conf \
32+
# Required for this demo: Create State file folder and set permissions
33+
&& mkdir -p /var/lib/nginx/state \
34+
&& chown -R nginx /var/lib/nginx/state \
35+
# COPY var/lib/nginx/state/upstreams.state /var/lib/nginx/state/upstreams.state
36+
&& touch /var/lib/nginx/state/upstreams.state
37+
38+
# Copy certificate files and dhparams
39+
COPY etc/ssl /etc/ssl
40+
41+
# COPY /etc/nginx (Nginx configuration) directory
42+
COPY etc/nginx /etc/nginx
43+
RUN chown -R nginx:nginx /etc/nginx \
44+
# # Forward request logs to Docker log collector:
45+
# && ln -sf /dev/stdout /var/log/nginx/access.log \
46+
# && ln -sf /dev/stderr /var/log/nginx/error.log \
47+
# Remove the cert/keys from the image
48+
&& rm /etc/ssl/nginx/nginx-repo.crt /etc/ssl/nginx/nginx-repo.key
49+
50+
# COPY /usr/share/nginx/html (Nginx files) directory
51+
COPY usr/share/nginx/html /usr/share/nginx/html
52+
RUN chown -R nginx:nginx /usr/share/nginx/html
53+
54+
# EXPOSE ports, HTTP 80, HTTP 8080, HTTPS 443, Nginx API / status page 9000, Prometheus Exporter page 9113
55+
EXPOSE 80 443 8080 9000 9113
56+
STOPSIGNAL SIGTERM
57+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)