diff --git a/content/nginx-one/workshops/lab1.md b/content/nginx-one/workshops/lab1/lab1.md similarity index 100% rename from content/nginx-one/workshops/lab1.md rename to content/nginx-one/workshops/lab1/lab1.md diff --git a/content/nginx-one/workshops/lab2.md b/content/nginx-one/workshops/lab2.md index 3c27b7d7f..31b0aabfb 100644 --- a/content/nginx-one/workshops/lab2.md +++ b/content/nginx-one/workshops/lab2.md @@ -1,15 +1,151 @@ --- -# We use sentence case and present imperative tone -title: "Lab2" -# Weights are assigned in increments of 100: determines sorting order +title: "Run workshop components with Docker" weight: 200 -# Creates a table of contents and sidebar, useful for large documents -toc: false -# Types have a 1:1 relationship with Hugo archetypes, so you shouldn't need to change this +toc: true nd-content-type: tutorial -# Intended for internal catalogue and search, case sensitive: -# Agent, N4Azure, NIC, NIM, NGF, NAP-DOS, NAP-WAF, NGINX One, NGINX+, Solutions, Unit -nd-product: NGINX-ONE +nd-product: nginx-one --- -blah \ No newline at end of file +## Introduction + +This guide shows you how to run a demo backend application and multiple NGINX OSS and Plus containers with Docker. The backend application runs in three `nginxinc/ingress-demo` containers, each serving a simple web page. You’ll also link each NGINX container to NGINX One Console for management and monitoring. + +## What you’ll learn + +By the end of this tutorial, you’ll know how to: + +- Set up environment variables for your data plane key and license +- Log in to the NGINX private registry +- Generate self-signed certificates +- Run Docker Compose to start 9 containers +- Verify your containers in Docker and in NGINX One Console + +## Before you begin + +Make sure you have: + +- An F5 Distributed Cloud (XC) account +- NGINX One service enabled in your XC account +- Docker and Docker Compose installed and running +- An active data plane key from [Lab 1: Get started with NGINX One Console]({{< ref "nginx-one/workshops/lab1/lab1.md" >}}) +- A trial or paid NGINX Plus JWT license (saved as `nginx-repo.jwt`) from [MyF5](https://my.f5.com/manage/s/). +- Basic Linux and NGINX know-how +- Git installed and SSH key set up for GitHub access + +--- + +## Clone the NGINX documentation repo + +1. **Clone the repo via SSH** + + ```shell + git clone git@github.com:nginx/documentation.git + ``` + +2. **Change to the Lab 2 directory** + + ```shell + cd documentation/content/nginx-one/workshops/lab2 + ``` + +This folder contains `docker-compose.yml` and `generate_certs.sh`. + +--- + +## Set environment variables + +1. **Set your data plane key** + + ```shell + export TOKEN="paste-your-data-plane-key-here" + echo "$TOKEN" + ``` + +2. **Set your NGINX Plus JWT** + + ```shell + export JWT=$(cat path/to/nginx-repo.jwt) + echo "$JWT" + ``` + +3. **Give your setup a unique name** + + Replace `your.initials` with something that identifies you or your setup (for example, `s.jobs`) + + ```shell + export NAME="your.initials" + echo "$NAME" + ``` + +--- + +## Log in to the private registry + +Pipe your JWT into Docker login: + +```shell +echo "$JWT" | docker login private-registry.nginx.com \ + --username "$JWT" --password-stdin +``` + +You should see **Login Succeeded**. + +--- + +## Generate certificates + +Run the script to create self-signed certs: + +```shell +chmod +x generate_certs.sh +./generate_certs.sh +``` + +This creates `1-day.key`, `1-day.crt`, `30-day.key`, and `30-day.crt` in the `nginx-oss/etc/ssl/nginx` subfolder. + +--- + +## Run Docker Compose + +Start all nine containers in detached mode: + +```shell +docker compose up --force-recreate -d +``` + +Wait until you see "Started" for each container. + +--- + +## Verify containers + +1. **Check Docker** + + ```shell + docker ps | grep "$NAME" + ``` + + You should see 9 containers listed. + +2. **Check NGINX One Console** + + - Go to the **Instances** page in the NGINX One Console + - Refresh and search by your `$NAME` (for example, `s.jobs`) + - Confirm each instance shows a green **Online* icon. + +If you don’t see them, double-check your `$TOKEN` or generate a new data plane key. + +--- + +## Next steps + +Now that your containers are up and registered, go on to explore NGINX One Console features in Lab 3. + +[Go to Lab 3 →](../lab3/readme.md) + +--- + +## References + +- [NGINX One Console docs](https://docs.nginx.com/nginx-one/) +- [NGINX Agent overview](https://docs.nginx.com/nginx-agent/overview/) diff --git a/content/nginx-one/workshops/lab2/docker-compose.yml b/content/nginx-one/workshops/lab2/docker-compose.yml new file mode 100644 index 000000000..a22431c7d --- /dev/null +++ b/content/nginx-one/workshops/lab2/docker-compose.yml @@ -0,0 +1,164 @@ +# NGINX Plus / OSS with NGINX Agent +# NGINX webservers with ingress-demo pages +# NGINX One Console Instance Registration +# NGINX Basics, Dec 2024 +# Chris Akker, Shouvik Dutta, Adam Currier +# +services: + plus1: # Alpine NGINX Plus Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey From One Console + # NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group + hostname: $NAME-plus1 + container_name: $NAME-plus1 + image: private-registry.nginx.com/nginx-plus/agent:nginx-plus-r32-alpine-3.20-20240613 # CVE - From Nginx Private Registry + volumes: # Sync these folders to container + - ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-plus/etc/nginx/includes:/etc/nginx/includes + - ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html + ports: + - 80:80 # Open for HTTP + - 443:443 # Open for HTTPS + - 9000:9000 # Open for stub status page + - 9113:9113 # Open for Prometheus Scraper page + restart: always + # + plus2: # Alpine NGINX Plus Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console + # NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group + hostname: $NAME-plus2 + container_name: $NAME-plus2 + image: private-registry.nginx.com/nginx-plus/agent:nginx-plus-r31-alpine-3.19-20240522 # CVE - From Nginx Private Registry + volumes: # Sync these folders to container + - ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-plus/etc/nginx/includes:/etc/nginx/includes + - ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + - '9000' # Open for API / Dashboard page + - '9113' # Open for Prometheus Scraper page + restart: always + # + plus3: # RHEL UBI NGINX Plus Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console + # NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group + hostname: $NAME-plus3 + container_name: $NAME-plus3 + image: private-registry.nginx.com/nginx-plus/agent:nginx-plus-r31-ubi-9-20240522 # From Nginx Private Registry + volumes: # Sync these folders to container + - ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-plus/etc/nginx/includes:/etc/nginx/includes + - ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + - '9000' # Open for API / Dashboard page + - '9113' # Open for Prometheus Scraper page + restart: always + # + oss1: # Debian NGINX OSS Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console + hostname: $NAME-oss1 + container_name: $NAME-oss1 + image: docker-registry.nginx.com/nginx/agent:mainline # From Docker Public Registry + volumes: # Sync these folders to container + - ./nginx-oss/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-oss/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-oss/etc/nginx/includes:/etc/nginx/includes + - ./nginx-oss/etc/ssl/nginx:/etc/ssl/nginx + - ./nginx-oss/usr/share/nginx/html:/usr/share/nginx/html + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + - '9000' # Open for stub status page + - '9113' # Open for Prometheus Scraper page + restart: always + # + oss2: # Alpine NGINX OSS Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console + hostname: $NAME-oss2 + container_name: $NAME-oss2 + image: docker-registry.nginx.com/nginx/agent:alpine # From Docker Public Registry + volumes: # Sync these folders to container + - ./nginx-oss/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-oss/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-oss/etc/nginx/includes:/etc/nginx/includes + - ./nginx-oss/etc/ssl/nginx:/etc/ssl/nginx + - ./nginx-oss/usr/share/nginx/html:/usr/share/nginx/html + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + - '9000' # Open for stub status page + - '9113' # Open for Prometheus Scraper page + restart: always + # + oss3: # Older Alpine NGINX OSS Web / Load Balancer + environment: + NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com' + NGINX_AGENT_SERVER_GRPCPORT: '443' + NGINX_AGENT_TLS_ENABLE: 'true' + NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console + hostname: $NAME-oss3 + container_name: $NAME-oss3 + image: docker-registry.nginx.com/nginx/agent:1.26-alpine # From Docker Public Registry + volumes: # Sync these folders to container + - ./nginx-oss/etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./nginx-oss/etc/nginx/conf.d:/etc/nginx/conf.d + - ./nginx-oss/etc/nginx/includes:/etc/nginx/includes + - ./nginx-oss/etc/ssl/nginx:/etc/ssl/nginx + - ./nginx-oss/usr/share/nginx/html:/usr/share/nginx/html + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + - '9000' # Open for stub status page + - '9113' # Open for Prometheus Scraper page + restart: always + # + web1: + hostname: $NAME-web1 + container_name: $NAME-web1 + platform: linux/amd64 + image: nginxinc/ingress-demo # Image from Docker Hub + ports: + - '80' # Open for HTTP + - '443' # Open for HTTPS + web2: + hostname: $NAME-web2 + container_name: $NAME-web2 + platform: linux/amd64 + image: nginxinc/ingress-demo + ports: + - '80' + - '433' + web3: + hostname: $NAME-web3 + container_name: $NAME-web3 + platform: linux/amd64 + image: nginxinc/ingress-demo + ports: + - '80' + - '443' + diff --git a/content/nginx-one/workshops/lab2/generate_certs.sh b/content/nginx-one/workshops/lab2/generate_certs.sh new file mode 100755 index 000000000..4ea736e4f --- /dev/null +++ b/content/nginx-one/workshops/lab2/generate_certs.sh @@ -0,0 +1,7 @@ +echo "Generate 1-day cert." +openssl req -x509 -nodes -days 1 -newkey rsa:2048 -keyout nginx-oss/etc/ssl/nginx/1-day.key -out nginx-oss/etc/ssl/nginx/1-day.crt -subj "/CN=$NAME-NginxOneWorkshop" +echo "Generate 30-day cert." +openssl req -x509 -nodes -days 30 -newkey rsa:2048 -keyout nginx-oss/etc/ssl/nginx/30-day.key -out nginx-oss/etc/ssl/nginx/30-day.crt -subj "/CN=$NAME-NginxOneWorkshop" +echo "copy certs to lab5 for future labs" +cp nginx-oss/etc/ssl/nginx/1-day.* ../lab5/nginx-oss/etc/ssl/nginx/ +cp nginx-oss/etc/ssl/nginx/30-day.* ../lab5/nginx-oss/etc/ssl/nginx/ \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf new file mode 100644 index 000000000..3af707162 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf @@ -0,0 +1,27 @@ +# cafe.example.com HTTP +server { + # Listening on port 80 on all IP addresses on this machine + listen 80; + + server_name cafe.example.com; + + # status_zone cafe-VirtualServer; + + # Server specific logging + access_log /var/log/nginx/cafe.example.com.log main_ext; + error_log /var/log/nginx/cafe.example.com_error.log info; + + location / { + + proxy_buffering off; + + # Including best-practice headers are bonus points + include includes/proxy_headers.conf; + include includes/keepalive.conf; + + # status_zone /; + + proxy_pass http://nginx_cafe; + } + +} diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf new file mode 100644 index 000000000..8869acd65 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf @@ -0,0 +1,19 @@ +# ngx_http_stub_status_module (Available in NGINX OSS) +# provides Basic Status information http://nginx.org/en/docs/http/ngx_http_stub_status_module.html + +server { + listen 9000 ssl; # Listener for Stub Status + + ssl_certificate /etc/ssl/nginx/30-day.crt; + ssl_certificate_key /etc/ssl/nginx/30-day.key; + + location /basic_status { + stub_status; + } + + # Redirect requests for "/" to "/basic_status" + location / { + return 301 /basic_status; + } + +} \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf new file mode 100644 index 000000000..89c78dea4 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf @@ -0,0 +1,54 @@ +# cars.example.com HTTP/HTTPS +# NGINX Basics Workshop +# Nov 2024, Chris Akker, Shouvik Dutta, Adam Currier +# +server { + + listen 443 ssl; # Uncomment to change to port 443, add "ssl" parameter for terminating TLS on all IP addresses on this machine + + server_name cars.example.com; # Set hostname to match in request + +# Update the following lines for NGINX cert and key directives and file locations + + ssl_certificate /etc/ssl/nginx/cars.crt; + ssl_certificate_key /etc/ssl/nginx/cars.key; + + ssl_protocols TLSv1.1 TLSv1.3; + ssl_ciphers HIGH:!aNULL:3DES; + ssl_prefer_server_ciphers on; + + access_log /var/log/nginx/cars.example.com.log main; + + error_log /var/log/nginx/cars.example.com_error.log info; + + root /usr/share/nginx/html; # Set the root folder for the HTML and JPG files + + location / { + + default_type text/html; + return 200 "Let's go fast, you have reached cars.example.com, path $uri\n"; + } + + location /gtr { + + try_files $uri $uri.html; # Look for filename that matches the URI requested + } + + location /nsx { + + try_files $uri $uri.html; + } + + location /rcf { + + try_files $uri $uri.html; + } + + location /browse { # new URL path + + alias /usr/share/nginx/html; # Browse this folder + index index.html; # Use this file, but if it does *not* exist + autoindex on; # Perform directory/file browsing + } + +} diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf new file mode 100644 index 000000000..8570729c4 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf @@ -0,0 +1,34 @@ +# NGINX Basics, Plus Proxy to three upstream NGINX containers +# Nov 2024 - Chris Akker, Shouvik Dutta, Adam Currier +# nginx_cafe servers +# +upstream nginx_cafe { # Upstream block, the name is "nginx_cafe" + + # Uncomment the zone directive below to add metrics to the Dashboard + # zone nginx_cafe 256k; + + # Load Balancing Algorithms supported by NGINX + # - Round Robin (Default if nothing specified) + # - Least Connections + # - IP Hash + # - Hash (Any generic Hash) + + # Load Balancing Algorithms supported by NGINX Plus + # - Least Time Last Byte / Header + # - Random Two + + # Uncomment for Least-Time Last-Byte algorithm + # least_time last_byte; + + # From Docker-Compose: + server web1:80; + server web2:80; + server web3:80; + + # Uncomment for Cookie persistence + # sticky cookie srv_id expires=1m domain=.example.com path=/; + + # Uncomment for keepalive TCP connections to upstreams + keepalive 16; + +} \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/keepalive.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/keepalive.conf new file mode 100644 index 000000000..a9fbcf4ad --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/keepalive.conf @@ -0,0 +1,9 @@ +# Default is HTTP/1, keepalive is only enabled in HTTP/1.1 +proxy_http_version 1.1; + +# Remove the Connection header if the client sends it, +# it could be "close" to close a keepalive connection +proxy_set_header Connection ""; + +# Host request header field, or the server name matching a request +proxy_set_header Host $host; \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf new file mode 100644 index 000000000..296ea7bfc --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf @@ -0,0 +1,20 @@ +# Extended Log Format +# Nginx Basics +log_format main_ext 'remote_addr="$remote_addr", ' + '[time_local=$time_local], ' + 'request="$request", ' + 'status="$status", ' + 'http_referer="$http_referer", ' + 'body_bytes_sent="$body_bytes_sent", ' + 'Host="$host", ' + 'sn="$server_name", ' + 'request_time=$request_time, ' + 'http_user_agent="$http_user_agent", ' + 'http_x_forwarded_for="$http_x_forwarded_for", ' + 'request_length="$request_length", ' + 'upstream_address="$upstream_addr", ' + 'upstream_status="$upstream_status", ' + 'upstream_connect_time="$upstream_connect_time", ' + 'upstream_header_time="$upstream_header_time", ' + 'upstream_response_time="$upstream_response_time", ' + 'upstream_response_length="$upstream_response_length", '; diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf new file mode 100644 index 000000000..23a83d1dc --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf @@ -0,0 +1,12 @@ +## Set Headers to the proxied servers ## + +# client address in a binary form, value’s length is always 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses +proxy_set_header X-Real-IP $remote_addr; + +# X-Forwarded-For client request header field with the $remote_addr variable appended to it, +# separated by a comma. If the “X-Forwarded-For” field is not present in the client request header, +# the $proxy_add_x_forwarded_for variable is equal to the $remote_addr variable. +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + +# request scheme, “http” or “https” +proxy_set_header X-Forwarded-Proto $scheme; \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/nginx.conf b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/nginx.conf new file mode 100644 index 000000000..a3b502b64 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/nginx/nginx.conf @@ -0,0 +1,33 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log info; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + include /etc/nginx/includes/log_formats/*.conf; # Custom Access logs formats found here + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; + +} diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.crt b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.crt new file mode 100644 index 000000000..9d82699fe --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKTCCAhGgAwIBAgIUWH5Vduqn1kn5ND2uFhkuGlrktpQwDQYJKoZIhvcNAQEL +BQAwJDEiMCAGA1UEAwwZdC5tYXJ0aW4tTmdpbnhPbmVXb3Jrc2hvcDAeFw0yNTA2 +MTAxMzQ1MTVaFw0yNTA2MTExMzQ1MTVaMCQxIjAgBgNVBAMMGXQubWFydGluLU5n +aW54T25lV29ya3Nob3AwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDN +uOfWshP0CZwD3mVMaj8EfrkX93iYsH4mZ+d3UCyHaUS2ElkGZ4pp+V356atDi4Y+ +b+627JTcFcRrtp1Sr+lyJvvtyd6pnkxMj5OLH6nQsjswlIFTC+7kDIbqbKK8Th8P +J241nf+AGYu0+gALFeWLq5iCAWFxxR5ZyroHA4WWQTgwYpEPXmY2TCoQAsEJCGng +R56obiLsmjnJ+PJSnLoPeWunLREPL9cBevoiyf53vFswbA6Dk3LGdtqevCq8SOWo +Ui/PEsQk5uZXbBqkgvsV0GBEKqml+7YokED68pXUMNyug9VfldG1lYQkRWxsYAyx +W/Feah0Rbh67t22RYYNXAgMBAAGjUzBRMB0GA1UdDgQWBBR0DNzYiD7vHhJwW1+D +PxChogc5bDAfBgNVHSMEGDAWgBR0DNzYiD7vHhJwW1+DPxChogc5bDAPBgNVHRMB +Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCepptBfkmxuYflYx18yMnHCYye +6L6Sttw+EyM5tGYwGCIXvpceRNBNKn6PdT3MBYWPBrdt6qeNaBYVT84Hjh1+cWs1 +vl/5BQm/kFDUTsqrkUa98wSk5DMjawCvZT5Ga1ydGqe8Zd+JuLEF14HZdVbqnrbf +jh8ShtD2F7X4KqiHeh90csYCoqPlt8msI47iUZcTmpF1qeXZyG3N3nZ90BBKQkoS +/Gii2wwHnmzeJ5F6OFzxenPgwksr7wpa+42XzyVyBSTeuU5PYQtRZ1tGRXiai9cf +De8DVndD/+TQnRdOCUUAiFu8iAs+a8CV0Seh6C21fSOlKf0qH7nzr3DUcI61 +-----END CERTIFICATE----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.key b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.key new file mode 100644 index 000000000..8b0f752d4 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/1-day.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAA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squ2dhtOj7irNCi4VhAxCBXB+wEkEF/UsauP9ZSzdp +GRQqPjjss3FcO6zBlCrIkUKLwDaJJcSYCUbYlMzyXKkWZnYbvzVnct1GgE4WEnv5 +fNc1snp42jgQkw55wehpRRaLk/dmOfwv47akELQOgJVrYxM5zePflCGHAoGBANCj +09aptV6Bpf1zOWCGCFIzzcqggn5+PETwpldXBiveGJjLz2/H/rfCh91HJxE8eAcc +1bwPORjSj1t57ErFyeYdj5fZ1e1Xr/Fx9UF99sAl5C1o4Bwi90WZHGePoAxngJ3q +QwlQ+R04RD3irxGM9714BxO1byRipXgLl+imwQQlAoGAWhQCcXV0cUF9UVhVsVlE +tH4UsQvAgaKerIOAkkM/zIE8wUJFoESI4zr2Dn1zD6YNEDZu52KF7kN7N9+Jvvo5 +1McNDB1SdD6zmtpoQg0xjtajFfminLn3AvKQWJywCmg169P3ts7JOPAkc/ubOZAd ++2IFBJY/JD51eWkV8xz5faE= +-----END PRIVATE KEY----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.crt b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.crt new file mode 100644 index 000000000..013a9d3fa --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKTCCAhGgAwIBAgIUPJfiMcxOsDMy3iKz3UhyMGcRNVIwDQYJKoZIhvcNAQEL +BQAwJDEiMCAGA1UEAwwZdC5tYXJ0aW4tTmdpbnhPbmVXb3Jrc2hvcDAeFw0yNTA2 +MTAxMzQ1MTVaFw0yNTA3MTAxMzQ1MTVaMCQxIjAgBgNVBAMMGXQubWFydGluLU5n +aW54T25lV29ya3Nob3AwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9 +/Nt0yLEd8883WJ+SVL6LawyowxCGxjEr8U1pVOlNVzcGEu0vBUVGpTSMDo+LkvFK +Ts0xvESp3SJWU1V8QNrp/FbgbeMvBWOaiSecqk+ilOXHcfwpxQ1noaTOciLdDvJy +adl03u3+1Gtlv2+xNc7dzd/FyNghK2SytNmL3Jl1ne1es490z14AsMsCbXIKUX6Q +iz95LAhLopwW6MlzdXCE5CDbiKG8sJ7UTcVifbKEAIUg5kE8Jynyzh/iqmKb+ZmN +2YIUgcM/1sT0EEbhR1TnVPWFse+iq4iHqh6gWs6i+6dcePbAqtNO7slbqDDEjyfj +w01bqZmfd6MlgELwuwD1AgMBAAGjUzBRMB0GA1UdDgQWBBRhQGrp6xfJs3s5IAnb +WQPbkEO4wzAfBgNVHSMEGDAWgBRhQGrp6xfJs3s5IAnbWQPbkEO4wzAPBgNVHRMB +Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBjUSbzIH2NhPg2N7+vJ1PVL1H0 +1c9q/IhHAVqiXq7HZlJ0E7le4xZQN/R1QQbPTs669rr4LeNWiQPDOgglVG8h1rkr +AlNR6OQTKvTdKRjlgueJKlbEjfTU602FE3A9f+7EuyZYj7emNxMuzvfa658qMA00 +C2Zl7bBbXek/Y1u6LlQyDiKoOfkB1YTq1KaSw9bImLOpl6cWqG4UrkVFTCz13WvN +0bms0sOp8V843n6yqE5ibbCj9nb4H+bPK4UGtF4yhO1YLctw6TZfsQgA3jLKK9vB +/ReTSgSjlPBcleMNPKU9ltZyOfNMOusU+WlzxU3tWoeFi3HhXGOMkN/0LqE8 +-----END CERTIFICATE----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.key b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.key new file mode 100644 index 000000000..abf04be64 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/30-day.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC9/Nt0yLEd8883 +WJ+SVL6Lawyow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9lMnSocUtkyfAKx +pd18NZA0X2o05ZvFNSg2A2LodDVgpcd679L0xKi6wa4yDW72KOnFm5bqBxz1xsGr +HaDIA035OHZbv/QMrQVSJoE1Nlq373oua+m6R+UqyZKuf/wKEaEAZ8BezQKBgQCm +RSBQHol5KUxQA07C7dhqZIvZFTCkUV8Gw/MjNtlkjRulnDD4qC5PuNQ1EL63fwyf +iG2/jMs9Q/c1+PYA0E6D/MuG2JDjmffwYybFtEmV05A3LXUt/GpuZM6In5Ud0/97 +XU9T2DVEIRlQh2pHcHtmon7ChiV+JHvKlVOpkMQuYQKBgBy2Nfa4fIKvpa+q6PX4 +GiARS7bcZwVvj//MAtYbPkT0t0hBQVDqC9JD/evwFX5PB+Yru695WkQnMgrm0Bko +tEDAqKXNo2+pKWzRWCt8gi4ntz2ATfOZBTCdsd3Ib49EkBGbZevt/pTU/DkfWGV/ +/evjLdQNDUiEeHiY+PpGU+Qa +-----END PRIVATE KEY----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.crt b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.crt new file mode 100644 index 000000000..4eb6334ff --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDFTCCAf2gAwIBAgIUEQHIC+pN7UA+PwpufAGW4sFczqowDQYJKoZIhvcNAQEL +BQAwGjEYMBYGA1UEAwwPTmdpbnhQbHVzQmFzaWNzMB4XDTI1MDEwMjIyMDY0OVoX +DTI1MDEwMzIyMDY0OVowGjEYMBYGA1UEAwwPTmdpbnhQbHVzQmFzaWNzMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA17iXl8xC2AApcMaoPEu5w42U++ai +ZPPtgEoDGE/tgNZmWwHsmfdkKbhvcFX8vLwI1OD+mKPW0RcB56x0I29KRk8HGwwX +XXUuALmWuYVYNE71O2cBE/8JpgLlFgkbjYyFZekQeyb9QHeYxI47vCQqptBzQoCx +Bs/zi4lh+wgRYyXmHdTQ60183Gvxs4ujIDWnOC4/PGLr/ZLjySyBDM4+rtoz5xia +HZVBFA8HINTz4vjMkP1zrN4RsgSQQop8vuxlZsLlJCSWDMgkidu/uCvXxo+gHLMs +nrvDloEJuU1zx2va4i0e8Zr/eV/zVRIghKx9g/mBFFPnEdu0x7B48EfTnwIDAQAB +o1MwUTAdBgNVHQ4EFgQUDQzkk+0qMyn/nczCV7vJVlpFLnAwHwYDVR0jBBgwFoAU +DQzkk+0qMyn/nczCV7vJVlpFLnAwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAQEAWXBbXqEckARXPGQtasa5+uVqwokH4TJwbnQLfZsQV766OltS4Bv/ +MFDqmFxFLvsuM2jf1vodtJTq+cuUWtn1o+0MCDFWy3lTifk0wpQyg3xF6boHdBi4 +oGFKn7oPwWaTU8yjJzbvH6A5mfjO57YklAXlmZwWsEylsgR9D9jPTUkX82P+8Ad6 +UjWmFsopTwjit1rBAnBOL/oIGl2IFE5L4Vv8tcFsfpDGpCK/h9D3G25uQY36c0av +Q10lfV2+1eTQz//In+Li8zgGZa+XHtCxFPCEdcFQeEF3VkefgN7aL8qxmPgmSrqd +P13gMgo7HwFPoxvuUD3vN2DKIeqfa/H7Mg== +-----END CERTIFICATE----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.key b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.key new file mode 100644 index 000000000..3777400b3 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/etc/ssl/nginx/cars.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXuJeXzELYAClw +xqg8S7nDjZT75qJk8+2ASgMYT+2A1mZbAeyZ92QpuG9wVfy8vAjU4P6Yo9bRFwH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Uf7dJS/t5OsluJvF19jCHWZX+d +y6FD05g/IBPSvf99EhYM/MlfRNKtjK9jsE1NCbhy/utoSHvEnwGWR9G4dwKBgQCa +fbZ1frqgYJ67E39SVcB/WbtG8GQM0Cuim30YVTyu3BTunmpMnnG0iDC/4mvVIZwY +VFs9OTo74IexapKuJ8d8Mi/ZFqVpud8oZfix4n/Le+3+ZUaz+vzfPMYJtQ3LzftA +g3fFPU4n/6FaGbQf2KsCwQdG3Yce3Wf6Q/zLXpZ70QKBgEseUKnmYKvFjmyVdO94 +nesTUuu7DITx4M7I3ssdKz/9KdqjmnVQn3yiNEEHEvItvKEZvFMAKB7uJFmY/oGr +5DvP29lsr45FDTz2UWElz/LhsOkSBzRYQpXDkuaCl+lz7YE76S6F45vAy7RSY8TU ++57833tZa5uHl5GKhytuhGyQ +-----END PRIVATE KEY----- diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.html b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.html new file mode 100644 index 000000000..1b1bdfcd1 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.html @@ -0,0 +1,22 @@ + + +
+If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg new file mode 100644 index 000000000..be39ffe4a Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg differ diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/index.html b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/index.html new file mode 100644 index 000000000..5d2b3044c --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/index.html @@ -0,0 +1,24 @@ + + + +If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.
+ +For online documentation and support please refer to
+nginx.org.
+Commercial support is available at
+nginx.com.
Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.html b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.html new file mode 100644 index 000000000..fc1de05d1 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.html @@ -0,0 +1,22 @@ + + + +If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg new file mode 100644 index 000000000..f3c27f59e Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg differ diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.html b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.html new file mode 100644 index 000000000..468ddae0b --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.html @@ -0,0 +1,22 @@ + + + +If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg new file mode 100644 index 000000000..40faef6dc Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg differ diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf new file mode 100644 index 000000000..a770dba9e --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf @@ -0,0 +1,37 @@ +# cafe.example.com HTTP +server { + # Listening on port 80 on all IP addresses on this machine + listen 80; + + server_name cafe.example.com; + + status_zone cafe-VirtualServer; + + # Server specific logging + access_log /var/log/nginx/cafe.example.com.log main_ext; + error_log /var/log/nginx/cafe.example.com_error.log info; + + location / { + + # Including best-practice headers are bonus points + include includes/proxy_headers.conf; + include includes/keepalive.conf; + + status_zone /; + + proxy_pass http://nginx_cafe; + } + + # Active Healthchecks + location @health_check { + internal; # Requests by NGINX only + proxy_set_header Host cafe.example.com; + proxy_pass http://nginx_cafe; + health_check interval=5s fails=3 passes=2 uri=/ match=status_ok; + + # Health check logs are boring but errors are interesting + # access_log /var/log/nginx/health_check.log main; + access_log off; + error_log /var/log/nginx/error.log error; + } +} diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf new file mode 100644 index 000000000..3b1ace3d3 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf @@ -0,0 +1,24 @@ +# NGINX Plus Basics, Nov 2024 +# Chris Akker, Shouvik Dutta, Adam Currier +# dashboard.conf +# +server { + # Conventional port for the NGINX Plus API is 8080 + listen 9000; + access_log off; # reduce noise in access logs + + location /api/ { + # Enable in read-write mode + api write=on; + } + # Conventional location of the NGINX Plus dashboard + location = /dashboard.html { + root /usr/share/nginx/html; + } + + # Redirect requests for "/" to "/dashboard.html" + location / { + return 301 /dashboard.html; + } +} + \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/default.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/default.conf new file mode 100644 index 000000000..5a96b7304 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/default.conf @@ -0,0 +1,64 @@ +server { + listen 80 default_server; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location /test_header { + add_header X-Test-App true; + return 200 'HTTP/1.1 200 OK\nContent-Type: text/html\n\nWelcome to Lab 4 of the NGINX One Workshop!'; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} + + # enable /api/ location with appropriate access control in order + # to make use of NGINX Plus API + # + #location /api/ { + # api write=on; + # allow 127.0.0.1; + # deny all; + #} + + # enable NGINX Plus Dashboard; requires /api/ location to be + # enabled and appropriate access control for remote access + # + #location = /dashboard.html { + # root /usr/share/nginx/html; + #} +} diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf new file mode 100644 index 000000000..adc6bbef9 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf @@ -0,0 +1,5 @@ +# Simple health check expecting http 200 and correct Content-Type +match status_ok { + status 200; + header Content-Type = "text/html; charset=utf-8"; # For the nginx-cafe html +} \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf new file mode 100644 index 000000000..9879cf619 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf @@ -0,0 +1,34 @@ +# NGINX Basics, Plus Proxy to three upstream NGINX containers +# Nov 2024 - Chris Akker, Shouvik Dutta, Adam Currier +# nginx_cafe servers +# +upstream nginx_cafe { # Upstream block, the name is "nginx_cafe" + + # Uncomment the zone directive below to add metrics to the Dashboard + zone nginx_cafe 256k; + + # Load Balancing Algorithms supported by NGINX + # - Round Robin (Default if nothing specified) + # - Least Connections + # - IP Hash + # - Hash (Any generic Hash) + + # Load Balancing Algorithms supported by NGINX Plus + # - Least Time Last Byte / Header + # - Random Two + + # Uncomment for Least-Time Last-Byte algorithm + least_time last_byte; + + # From Docker-Compose: + server web1:80; + server web2:80; + server web3:80; + + # Uncomment for Cookie persistence + # sticky cookie srv_id expires=1m domain=.example.com path=/; + + # Uncomment for keepalive TCP connections to upstreams + keepalive 16; + +} \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/keepalive.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/keepalive.conf new file mode 100644 index 000000000..a9fbcf4ad --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/keepalive.conf @@ -0,0 +1,9 @@ +# Default is HTTP/1, keepalive is only enabled in HTTP/1.1 +proxy_http_version 1.1; + +# Remove the Connection header if the client sends it, +# it could be "close" to close a keepalive connection +proxy_set_header Connection ""; + +# Host request header field, or the server name matching a request +proxy_set_header Host $host; \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf new file mode 100644 index 000000000..296ea7bfc --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf @@ -0,0 +1,20 @@ +# Extended Log Format +# Nginx Basics +log_format main_ext 'remote_addr="$remote_addr", ' + '[time_local=$time_local], ' + 'request="$request", ' + 'status="$status", ' + 'http_referer="$http_referer", ' + 'body_bytes_sent="$body_bytes_sent", ' + 'Host="$host", ' + 'sn="$server_name", ' + 'request_time=$request_time, ' + 'http_user_agent="$http_user_agent", ' + 'http_x_forwarded_for="$http_x_forwarded_for", ' + 'request_length="$request_length", ' + 'upstream_address="$upstream_addr", ' + 'upstream_status="$upstream_status", ' + 'upstream_connect_time="$upstream_connect_time", ' + 'upstream_header_time="$upstream_header_time", ' + 'upstream_response_time="$upstream_response_time", ' + 'upstream_response_length="$upstream_response_length", '; diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf new file mode 100644 index 000000000..23a83d1dc --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf @@ -0,0 +1,12 @@ +## Set Headers to the proxied servers ## + +# client address in a binary form, value’s length is always 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses +proxy_set_header X-Real-IP $remote_addr; + +# X-Forwarded-For client request header field with the $remote_addr variable appended to it, +# separated by a comma. If the “X-Forwarded-For” field is not present in the client request header, +# the $proxy_add_x_forwarded_for variable is equal to the $remote_addr variable. +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + +# request scheme, “http” or “https” +proxy_set_header X-Forwarded-Proto $scheme; \ No newline at end of file diff --git a/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/nginx.conf b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/nginx.conf new file mode 100644 index 000000000..e6101912a --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/etc/nginx/nginx.conf @@ -0,0 +1,77 @@ + +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + include /etc/nginx/includes/log_formats/*.conf; # Custom Access logs formats found here + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} + + +# TCP/UDP proxy and load balancing block +# +#stream { + # Example configuration for TCP load balancing + + #upstream stream_backend { + # zone tcp_servers 64k; + # server backend1.example.com:12345; + # server backend2.example.com:12345; + #} + + #server { + # listen 12345; + # status_zone tcp_server; + # proxy_pass stream_backend; + #} +#} + +# NGINX Plus Usage Reporting +# +# By default, every 30 minutes, NGINX Plus will send usage information +# to NGINX Instance Manager, resolved by a "nginx-mgmt.local" DNS entry. +# Alternate settings can be configured by uncommenting the "mgmt" block +# and optional directives. +# +#mgmt { + #usage_report endpoint=nginx-mgmt.local interval=30m; + #resolver DNS_IP; + + #uuid_file /var/lib/nginx/nginx.id; + + #ssl_protocols TLSv1.2 TLSv1.3; + #ssl_ciphers DEFAULT; + + #ssl_certificate client.pem; + #ssl_certificate_key client.key; + + #ssl_trusted_certificate trusted_ca_cert.crt; + #ssl_verify on; + #ssl_verify_depth 2; +#} diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/dashboard.html b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/dashboard.html new file mode 100644 index 000000000..5f1d00bf1 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/dashboard.html @@ -0,0 +1,1929 @@ +If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg new file mode 100644 index 000000000..be39ffe4a Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg differ diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/index.html b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/index.html new file mode 100644 index 000000000..5d2b3044c --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/index.html @@ -0,0 +1,24 @@ + + + +If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.
+ +For online documentation and support please refer to
+nginx.org.
+Commercial support is available at
+nginx.com.
Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.html b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.html new file mode 100644 index 000000000..fc1de05d1 --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.html @@ -0,0 +1,22 @@ + + + +If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg new file mode 100644 index 000000000..f3c27f59e Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg differ diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.html b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.html new file mode 100644 index 000000000..468ddae0b --- /dev/null +++ b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.html @@ -0,0 +1,22 @@ + + + +If you see this page, the nginx web server is successfully installed and +working.
+ +
+
+Thank you for using nginx.
+ + diff --git a/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg new file mode 100644 index 000000000..40faef6dc Binary files /dev/null and b/content/nginx-one/workshops/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg differ diff --git a/content/nginx-one/workshops/lab2/readme.md b/content/nginx-one/workshops/lab2/readme.md new file mode 100644 index 000000000..663f11a70 --- /dev/null +++ b/content/nginx-one/workshops/lab2/readme.md @@ -0,0 +1,185 @@ +# Build workshop components within Docker + +## Introduction + +In this lab, you will be running the backend application and several NGINX OSS and Plus instances as Docker containers. All the NGINX containers would be attached to NGINX One Console as part of this exercise. + +