supachai-j / nginx-basic-course-training-part2

Nginx Basic Course Training Part 2 - Thailand.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NGINX Basic Course Training Part 2

เนื้อหา:

  1. Setting up NGINX Plus Dashboard, active health checks and view the metrics.
  2. Configuring key-value store and enable IP allow/deny list.
  3. Configuring Cache Manager.
  4. Enabling JWT Authentication.
  5. NGINX HA mode, Sync configuration and State Sharing Cluster (Option).
  6. Summary and Q&A.

เตรียมตัวก่อนการทดสอบ

  1. ติดตั้ง Ubuntu 18.04 Local VM หรือ Cloud Instance
  • ทำการ Copy โฟรเดอร์ Apps (App1, App2, App3, covid-app & jwt-app) ไปไว้ที่ภายใต้ "/opt/services"
  • กำหนดไฟล์ hosts บนเครื่อง
    <internal-ip> example.com www.example.com example123.com www.example123.com
  1. ติดตั้ง NGINX Plus (Lasted version).

1. Live Activity Dashboard.

อ้างอิงไฟล์ dashboard.conf

  • ในไฟล์ .conf มี servers อยู่ 3 Apps ให้บริการที่พอร์ต 9001, 9002 และ 9003.
  • Load Balancing ถูกตั้งค่า และเปิดบริการที่พอร์ต 9000.
  • API / Dashboard ให้บริการที่พอร์ต 8080.

ตัวอย่างและข้อมูลเพิ่มเติม :

2. Key-Value Store.

อ้างอิงไฟล์ key.value.store.conf

2.1 IP Allow/Deny List

$ curl -s -X GET 'http://<ip-address>:8080/api/6/http/keyvals/allowlist_zone' | jq

$ curl -X POST -d '{"<internal-ip>":"1"}' -s 'http://ip-address:8080/api/6/http/keyvals/allowlist_zone'

$ curl -X PATCH -d '{"<internal-ip>":"0"}' -s 'http://ip-address:8080/api/6/http/keyvals/allowlist_zone'

$ curl -s -X DELETE 'http://<ip-address>:8080/api/6/http/keyvals/allowlist_zone'
  • ทำการ blocked access สำหรับ internal IP. ค่า 1 ให้ Deny และ 0 ให้ Allow.

2.2 SSL Certificate Management

อ้างอิงไฟล์ key.value.store.conf

ตัวอย่างและข้อมูลเพิ่มเติม :

3. Cache Management.

อ้างอิงไฟล์ cache.management.conf

ตัวอย่างและข้อมูลเพิ่มเติม :

4. JWT Validation.

อ้างอิงไฟล์ jwt.validation.conf

ตัวอย่างและข้อมูลเพิ่มเติม :

5. NGINX HA.

5.1 NGINX Plus HA modes (Active-Standby/Active-Active).

5.2 NGINX Plus Synchronizing Configuration in Cluster.

5.3 NGINX Plus State Sharing in Cluster.

อ้างอิงโฟเดอร์ zone-sync-example

Closing Credits.

Credit by

Update and moddify by

About

Nginx Basic Course Training Part 2 - Thailand.


Languages

Language:HTML 100.0%