%%{init: {'theme':'base','themeVariables':{ 'primaryColor':'#3c3836','primaryTextColor':'#ebdbb2','primaryBorderColor':'#fabd2f', 'lineColor':'#a89984','secondaryColor':'#504945','tertiaryColor':'#282828', 'background':'#282828','mainBkg':'#3c3836','clusterBkg':'#32302f','clusterBorder':'#fabd2f' }}}%% flowchart LR Client["🖥️ Clientเบราว์เซอร์"] -->|HTTP Request| WS["⚙️ Web Server(Nginx/Caddy)"] WS -->|Static| FS[("📁 FilesystemHTML/CSS/JS")] WS -->|Dynamic| App["🐍 Application Server(Node.js/Python/PHP)"] App --> DB[("🗄️ Database")] WS -->|HTTP Response| Client style Client fill:#458588,stroke:#83a598,color:#ebdbb2 style WS fill:#d65d0e,stroke:#fe8019,color:#282828 style App fill:#98971a,stroke:#b8bb26,color:#282828 style DB fill:#b16286,stroke:#d3869b,color:#ebdbb2 style FS fill:#689d6a,stroke:#8ec07c,color:#282828
%%{init: {'theme':'base','themeVariables':{ 'primaryColor':'#3c3836','primaryTextColor':'#ebdbb2','primaryBorderColor':'#fabd2f', 'lineColor':'#a89984','background':'#282828' }}}%% sequenceDiagram participant C as Client participant S as Server Note over C,S: HTTP/1.1 Persistent C->>S: GET /index.html S-->>C: 200 OK + HTML C->>S: GET /style.css S-->>C: 200 OK + CSS Note over C,S: HTTP/2 Multiplexing C->>S: Stream 1: GET /index.html C->>S: Stream 3: GET /style.css C->>S: Stream 5: GET /app.js S-->>C: Stream 1, 3, 5 (parallel)
%%{init: {'theme':'base','themeVariables':{ 'primaryColor':'#3c3836','primaryTextColor':'#ebdbb2','primaryBorderColor':'#fabd2f', 'lineColor':'#a89984','clusterBkg':'#32302f','clusterBorder':'#fabd2f','background':'#282828' }}}%% flowchart TB subgraph Main["main context (global)"] M1["user, worker_processes,error_log, pid"] subgraph Events["events { }"] E1["worker_connections,use, multi_accept"] end subgraph Http["http { }"] H1["mime.types, log_format,gzip, ssl_protocols"] subgraph Server["server { } (virtual host)"] S1["listen, server_name,root, index"] subgraph Location["location { }"] L1["try_files, proxy_pass,return, rewrite"] end end end end style Main fill:#282828,stroke:#fabd2f,color:#ebdbb2 style Events fill:#3c3836,stroke:#83a598,color:#ebdbb2 style Http fill:#3c3836,stroke:#b8bb26,color:#ebdbb2 style Server fill:#504945,stroke:#fe8019,color:#ebdbb2 style Location fill:#665c54,stroke:#d3869b,color:#ebdbb2
%%{init: {'theme':'base','themeVariables':{ 'primaryColor':'#3c3836','primaryTextColor':'#ebdbb2','primaryBorderColor':'#fabd2f', 'lineColor':'#a89984','clusterBkg':'#32302f','clusterBorder':'#fabd2f','background':'#282828' }}}%% flowchart LR subgraph Forward["🔵 Forward Proxy (ตัวแทน Client)"] C1["Client A"] --> FP["Forward Proxy (Squid, Tor)"] C2["Client B"] --> FP FP --> Internet["🌐 Internet"] end subgraph Reverse["🟠 Reverse Proxy (ตัวแทน Server)"] Inet["🌐 Internet Clients"] --> RP["Reverse Proxy (Nginx, Caddy)"] RP --> B1["Backend 1"] RP --> B2["Backend 2"] RP --> B3["Backend 3"] end Forward ~~~ Reverse style Forward fill:#282828,stroke:#83a598,color:#ebdbb2 style Reverse fill:#282828,stroke:#fe8019,color:#ebdbb2 style FP fill:#458588,stroke:#83a598,color:#ebdbb2 style RP fill:#d65d0e,stroke:#fe8019,color:#282828
%%{init: {'theme':'base','themeVariables':{ 'primaryColor':'#3c3836','primaryTextColor':'#ebdbb2','primaryBorderColor':'#fabd2f', 'lineColor':'#a89984','background':'#282828' }}}%% sequenceDiagram participant C as Client (Browser) participant S as Server (Nginx) participant CA as CA Note over CA: ออกใบรับรองให้ S ล่วงหน้า C->>S: ClientHello (TLS, ciphers) S->>C: ServerHello + Certificate C->>C: ตรวจลายเซ็นด้วยPublic Key ของ CA C->>S: Key Exchange (ECDHE) S->>C: Key Exchange Note over C,S: คำนวณ Session Key C->>S: Finished (encrypted) S->>C: Finished (encrypted) Note over C,S: 🔒 Encrypted