diff --git a/content/nginx-one/workshops/lab1/getting-started-with-nginx-one.md b/content/nginx-one/workshops/lab1/getting-started-with-nginx-one.md index a9650fa8d..cfc7c6ad2 100644 --- a/content/nginx-one/workshops/lab1/getting-started-with-nginx-one.md +++ b/content/nginx-one/workshops/lab1/getting-started-with-nginx-one.md @@ -116,7 +116,7 @@ You can only delete a key after you revoke it. Now that you’ve explored NGINX One Console and created a key, you’re ready to connect your first NGINX instance. -[Go to Lab 2: Run workshop components with Docker]({{< ref "nginx-one/workshops/lab2/run-workshop-components-with-docker.md" >}}) +Go to [Lab 2: Run workshop components with Docker]({{< ref "nginx-one/workshops/lab2/run-workshop-components-with-docker.md" >}}) --- diff --git a/content/nginx-one/workshops/lab2/run-workshop-components-with-docker.md b/content/nginx-one/workshops/lab2/run-workshop-components-with-docker.md index 85a7aaa50..13eefc45d 100644 --- a/content/nginx-one/workshops/lab2/run-workshop-components-with-docker.md +++ b/content/nginx-one/workshops/lab2/run-workshop-components-with-docker.md @@ -45,11 +45,15 @@ Make sure you have: 2. **Change to the Lab 2 directory** ```shell - cd workshops/nginx-one/lab2 + cd static/workshops/nginx-one/lab2 ``` This folder contains `docker-compose.yml` and `generate_certs.sh`. +{{}} {{}} + +{{}} {{}} + --- ## Set environment variables @@ -141,7 +145,7 @@ If you don’t see them, double-check your `$TOKEN` or generate a new data plane 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) +Go to [Lab 3: Explore NGINX One Console features]({{< ref "nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md" >}}) --- diff --git a/content/nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md b/content/nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md index db653b8cc..3d2a7a296 100644 --- a/content/nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md +++ b/content/nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md @@ -33,9 +33,14 @@ By the end of this tutorial, you’ll know how to: Make sure you have: - An F5 Distributed Cloud (XC) account with NGINX One enabled -- All containers from Lab 2 running and registered +- All containers from [Lab 2](nginx-one/workshops/lab2/run-workshop-components-with-docker.md) running and registered +- Your unique identifier in the `NAME` environment variable (set in Lab 2), for example `s.jobs`: + + ```shell + export NAME="s.jobs" + ``` + - Basic NGINX and Linux knowledge -- Your `$NAME` environment variable set (from [Lab 2]({{< ref "nginx-one/workshops/lab2/run-workshop-components-with-docker.md" >}})) --- @@ -174,7 +179,7 @@ Try it on: ## Next steps -When you’re ready, move on to [Lab 4 →](../lab4/readme.md) +Go to [Lab 4: Config Sync Groups]({{< ref "nginx-one/workshops/lab4/config-sync-groups.md" >}}) --- diff --git a/content/nginx-one/workshops/lab4/config-sync-groups.md b/content/nginx-one/workshops/lab4/config-sync-groups.md new file mode 100644 index 000000000..6c8eaf9a3 --- /dev/null +++ b/content/nginx-one/workshops/lab4/config-sync-groups.md @@ -0,0 +1,213 @@ +--- +title: "Lab 4: Config Sync Groups" +weight: 400 +toc: true +nd-content-type: tutorial +nd-product: nginx-one +--- + +## Overview + +In this lab, you create and manage Config Sync Groups in NGINX One Console. Config Sync Groups keep your NGINX instances in sync with a shared configuration. You learn to create a group, add instances, apply a shared config, and fix sync errors. + +## What you’ll learn + +By the end of this lab, you'll know how to: + +- Create a Config Sync Group +- Add instances to a Config Sync Group +- Update the shared configuration for a Config Sync Group + +## Before you begin + +Make sure you have: + +- Completed [Lab 2: Run workshop components with Docker]({{< ref "nginx-one/workshops/lab2/run-workshop-components-with-docker.md" >}}) +- Docker and Docker Compose installed and running +- Your data plane key in the `TOKEN` environment variable (set in Lab 2): + + ```shell + export TOKEN="your-data-plane-key" + ``` + +- Your NGINX Plus JWT license file saved as `nginx-repo.jwt`, and `JWT` set (set in Lab 2): + + ```shell + export JWT=$(cat path/to/nginx-repo.jwt) + ``` + +- Your unique identifier in the NAME environment variable (set in Lab 2), for example `s.jobs`: + + ```shell + export NAME="s.jobs" + ``` + +- Basic familiarity with Linux command line and NGINX concepts + +--- + +## Exercise 1: Create a Config Sync Group + +A Config Sync Group lets you apply one configuration to multiple NGINX instances and keep them in sync. + +1. In the NGINX One Console, select **Manage > Config Sync Groups**. +2. In the **Config Sync Groups** pane, select **Add Config Sync Group**. +3. In the **Add Config Sync Group** form, in the **Name** field, enter `$NAME-sync-group` (for example, `s.jobs-sync-group`). +4. Select **Create**. The new group appears with **Details** and **Configuration** tabs. + - The **Details** tab shows: + - Object ID + - Last publication status and config version ID + - Config Sync Status (for example, Unknown) + - Instance status counts (In Sync, Out of Sync, Offline, Unavailable) +5. Switch to the **Configuration** tab to view your group’s configuration files. It’s empty for now. You’ll add one in Exercise 2. + +--- + +## Exercise 2: Add instances to the Config Sync Group + +{{< call-out "note" "Note" "" >}} You can mix OSS and Plus instances in one group. But any config feature you use must work on every instance. If you need Plus-only features, put them in a separate group. {{}} + +When you create a Config Sync Group, it has no shared config to begin with. You can add a shared config in two ways: + +- **Define config manually**: select your group, go to the **Configuration** tab, then select **Edit Configuration**. Add or paste your NGINX config, select **Next**, review the diff, and select **Save and Publish**. +- **Populate from first instance**: add one NGINX instance. The console uses that instance’s existing config as the group’s shared config. + +### Populate group config from first instance + +Add a single NGINX instance so the console uses its existing config as the group’s shared config. + +1. Select **Manage > Config Sync Groups**. +2. Select your `$NAME-sync-group` group. (For example, `s.jobs-sync-group`.) +3. On the **Details** tab, in the **Instances** pane, select **Add Instance to Config Sync Group**. +4. Select **Register a new instance with NGINX One then add to config sync group**, then select **Next**. +5. Select **Use existing key**, paste `$TOKEN` (or your actual data plane key) into the **Data Plane Key** box. +6. Select the **Docker Container** tab. The tab shows sample commands for logging in, pulling an image, and running the container. Copy those sample commands and modify them as follows: + +7. Log in to the private registry: + + ```shell + echo "$JWT" \ + | docker login private-registry.nginx.com \ + --username "$JWT" --password-stdin + ``` + +8. Pull a Docker (replace version as needed). Subject to availability, you can replace the agent with the specific NGINX Plus version, OS type, and OS version you need. Here we are going to pull the r31 version of NGINX+ on alpine to demonstrate that.See [Pulling the image]({{< ref "nginx/admin-guide/installing-nginx/installing-nginx-docker.md#pull-the-image" >}}). + + ```shell + docker pull private-registry.nginx.com/nginx-plus/agent:nginx-plus-r31-alpine-3.19-20240522 + ``` + +9. Copy the docker run command from the user interface and modify it as follows: + + - Replace `YOUR_JWT_HERE` in `--env NGINX_LICENSE_JWT` with `$JWT` + - Replace `YOUR_DATA_PLANE_KEY` in `--env NGINX_AGENT_SERVER_TOKEN` with `$TOKEN` + - Add `--hostname "$NAME-one-manual"` and `--name "$NAME-one-manual"` flags + - Ensure `--env NGINX_AGENT_INSTANCE_GROUP="$NAME-sync-group"` is set + + ```shell + docker run \ + --hostname "$NAME-one-manual" \ + --name "$NAME-one-manual" \ + --env NGINX_LICENSE_JWT="$JWT" \ + --env NGINX_AGENT_SERVER_GRPCPORT=443 \ + --env NGINX_AGENT_SERVER_HOST=agent.connect.nginx.com \ + --env NGINX_AGENT_SERVER_TOKEN="$TOKEN" \ + --env NGINX_AGENT_INSTANCE_GROUP="$NAME-sync-group" \ + --env NGINX_AGENT_TLS_ENABLE=true \ + --restart always \ + --runtime runc \ + -d private-registry.nginx.com/nginx-plus/agent:nginx-plus-r31-alpine-3.19-20240522 + ``` + +10. In the **Config Sync Groups** panel, select **Refresh**. The new instance appears and the shared config populates. The first instance added becomes the default config source. +11. Select the **Configuration** tab to view the shared config. + +#### Add instances using Docker Compose + +Instead of registering each container manually, you can set the sync group in your compose file and restart all containers at once. + +You can edit the `docker-config.yaml` file to add those instances to the config sync group: + +1. Stop the running containers: + + ```shell + docker compose down + ``` + +2. Open `docker-compose.yaml` in a text editor. +3. Uncomment the lines beginning with: + + ```yaml + NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group + ``` + +4. Restart all containers: + + ```shell + docker compose up --force-recreate -d + ``` + +5. In the NGINX One Console, select **Refresh**. The instances with `NGINX_AGENT_INSTANCE_GROUP` set appear in the Config Sync Group. + +6. Instances automatically sync the existing NGINX config. When the sync finishes, the **Config Sync Status** shows `In Sync`. + + +{{< img src="nginx-one/images/config-sync-status.png" + alt="Table showing hostnames, NGINX versions, operating systems, availability status, and green In Sync indicators for each instance in the config sync group" >}} + + + +## Exercise 3: Edit the group config and sync changes + +Modify the shared group configuration and apply those changes to all group members. + +1. Select **Manage > Config Sync Groups**, then choose your `$NAME-sync-group` (for example, `s-jobs-sync-group`). +2. Select the **Configuration** tab. +3. Select **Edit Configuration** (pencil icon). +4. In the file list, select `default.conf`. +5. In the editor pane, add these lines at 21–24: + + ```yaml + 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 Console Workshop!'; + } + ``` + + + {{< img src="nginx-one/images/config-sync-edits.png" + alt="" >}} + + + When you make these edits, the file is marked "modified" and the validator shows **NGINX Config OK**. +6. Select **Next**, review the diff, then select **Save and Publish**. +7. Select the **Details** tab and confirm **Last Publication Status** shows **Succeeded**. +8. In the **Instances** table, confirm each host shows **Config Sync Status** = **In Sync**. +9. Test your change by curling any instance’s HTTP endpoint. Replace `` and `` with your instance’s host name or IP and the port shown in the Instances table (for example, `localhost:80`): + + ```shell + curl http://localhost:80/test_header + ``` + + You should see: + + ```text + HTTP/1.1 200 OK + Content-Type: text/html + + Welcome to Lab 4 of the NGINX One Console Workshop! + ``` + +--- + +## Next steps + +You have created a Config Sync Group and added instances. In Lab 5, you will install your NGINX Plus license (JWT) on each instance so you can upgrade them to NGINX R34. + +Go to [Lab 5: Upgrade to R34]() + +--- + +## References + +- [NGINX One Console docs](https://docs.nginx.com/nginx-one/) diff --git a/static/nginx-one/images/config-sync-edits.png b/static/nginx-one/images/config-sync-edits.png new file mode 100644 index 000000000..f8a47580c Binary files /dev/null and b/static/nginx-one/images/config-sync-edits.png differ diff --git a/static/nginx-one/images/config-sync-status.png b/static/nginx-one/images/config-sync-status.png new file mode 100644 index 000000000..272f36963 Binary files /dev/null and b/static/nginx-one/images/config-sync-status.png differ diff --git a/workshops/nginx-one/lab2/docker-compose.yml b/static/workshops/nginx-one/lab2/docker-compose.yml similarity index 100% rename from workshops/nginx-one/lab2/docker-compose.yml rename to static/workshops/nginx-one/lab2/docker-compose.yml diff --git a/workshops/nginx-one/lab2/generate_certs.sh b/static/workshops/nginx-one/lab2/generate_certs.sh similarity index 100% rename from workshops/nginx-one/lab2/generate_certs.sh rename to static/workshops/nginx-one/lab2/generate_certs.sh diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/cafe.example.com.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/stub_status.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/tls-cars.example.com.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/conf.d/upstreams.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/keepalive.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/keepalive.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/keepalive.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/keepalive.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/log_formats/main_ext.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/includes/proxy_headers.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/nginx/nginx.conf b/static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/nginx.conf similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/nginx/nginx.conf rename to static/workshops/nginx-one/lab2/nginx-oss/etc/nginx/nginx.conf diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.crt b/static/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.crt similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.crt rename to static/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.crt diff --git a/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.key b/static/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.key similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.key rename to static/workshops/nginx-one/lab2/nginx-oss/etc/ssl/nginx/cars.key diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.html b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.html rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.html diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/gtr.jpg diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/index.html b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/index.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/index.html rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/index.html diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.html b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.html rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.html diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/nsx.jpg diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.html b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.html rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.html diff --git a/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg b/static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg rename to static/workshops/nginx-one/lab2/nginx-oss/usr/share/nginx/html/rcf.jpg diff --git a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf b/static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf similarity index 93% rename from workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf rename to static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf index 5a96b7304..013d7b423 100644 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf +++ b/static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/default.conf @@ -18,11 +18,11 @@ server { root /usr/share/nginx/html; } - location /test_header { + 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!'; + return 200 'HTTP/1.1 200 OK\nContent-Type: text/html\n\nWelcome to Lab 4 of the NGINX One Console Workshop!'; } - + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { diff --git a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf b/static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf similarity index 93% rename from workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf rename to static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf index e6101912a..f0ece9626 100644 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf +++ b/static/workshops/nginx-one/lab2/nginx-plus/etc/nginx/nginx.conf @@ -1,6 +1,6 @@ user nginx; -worker_processes 1; +worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; @@ -19,8 +19,6 @@ http { '$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; diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/dashboard.html b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/dashboard.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/dashboard.html rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/dashboard.html diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.html b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.html rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.html diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/gtr.jpg diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/index.html b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/index.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/index.html rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/index.html diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.html b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.html rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.html diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/nsx.jpg diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.html b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.html similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.html rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.html diff --git a/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg b/static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg similarity index 100% rename from workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg rename to static/workshops/nginx-one/lab2/nginx-plus/usr/share/nginx/html/rcf.jpg diff --git a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf deleted file mode 100644 index a770dba9e..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/cafe.example.com.conf +++ /dev/null @@ -1,37 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf deleted file mode 100644 index 3b1ace3d3..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/dashboard.conf +++ /dev/null @@ -1,24 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf deleted file mode 100644 index adc6bbef9..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/status_ok.conf +++ /dev/null @@ -1,5 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf deleted file mode 100644 index 9879cf619..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/conf.d/upstreams.conf +++ /dev/null @@ -1,34 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/keepalive.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/keepalive.conf deleted file mode 100644 index a9fbcf4ad..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/keepalive.conf +++ /dev/null @@ -1,9 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf deleted file mode 100644 index 296ea7bfc..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/log_formats/main_ext.conf +++ /dev/null @@ -1,20 +0,0 @@ -# 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/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf b/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf deleted file mode 100644 index 23a83d1dc..000000000 --- a/workshops/nginx-one/lab2/nginx-plus/etc/nginx/includes/proxy_headers.conf +++ /dev/null @@ -1,12 +0,0 @@ -## 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