@@ -4,6 +4,8 @@ This diagram shows how user requests travel through NGINX Gateway Fabric.
4
4
5
5
## Simple Overview
6
6
7
+ ** Note:** NGINX routes traffic directly to Pods. Services are used for Pod information gathering, not as routing intermediaries.
8
+
7
9
``` mermaid
8
10
%%{init: {'theme':'dark', 'themeVariables': {'fontSize': '16px', 'darkMode': true, 'primaryColor': '#4f46e5', 'primaryTextColor': '#e5e7eb', 'primaryBorderColor': '#6b7280', 'lineColor': '#9ca3af', 'secondaryColor': '#1f2937', 'tertiaryColor': '#374151', 'background': '#111827', 'mainBkg': '#1f2937', 'secondBkg': '#374151', 'tertiaryTextColor': '#d1d5db'}}}%%
9
11
graph LR
@@ -22,13 +24,11 @@ graph LR
22
24
end
23
25
end
24
26
25
- %% Simple flow
27
+ %% Simple flow - NGINX routes directly to Pods
26
28
USER --> NGINX
27
- NGINX --> SVC1
28
- NGINX --> SVC2
29
- SVC1 --> POD1
30
- SVC1 --> POD2
31
- SVC2 --> POD3
29
+ NGINX --> POD1
30
+ NGINX --> POD2
31
+ NGINX --> POD3
32
32
33
33
%% Dark-friendly styling
34
34
style USER fill:#fbbf24,stroke:#f59e0b,stroke-width:2px,color:#1f2937
@@ -54,15 +54,15 @@ User Request:
54
54
``` text
55
55
NGINX Gateway:
56
56
├── Receives request from user
57
- ├── Applies SSL termination
57
+ ├── Applies SSL termination (only if a user configures it to do so)
58
58
├── Matches routing rules
59
- └── Selects backend service
59
+ └── Selects backend pod
60
60
```
61
61
62
- ### 3. Service Processes Request
62
+ ### 3. Pod Processes Request
63
63
64
64
``` text
65
- Backend Service :
65
+ Backend Pod :
66
66
├── Receives request from NGINX
67
67
├── Processes business logic
68
68
├── Queries database (if needed)
@@ -74,7 +74,7 @@ Backend Service:
74
74
75
75
``` text
76
76
Response Flow:
77
- ├── Service → NGINX
77
+ ├── Pod → NGINX
78
78
├── NGINX → User
79
79
└── Request complete
80
80
```
@@ -86,54 +86,45 @@ Response Flow:
86
86
sequenceDiagram
87
87
participant User
88
88
participant NGINX
89
- participant Service as Backend Service
90
89
participant Pod
91
90
92
91
User->>NGINX: HTTP Request
93
92
NGINX->>NGINX: Route matching
94
- NGINX->>Service: Proxy to service
95
- Service->>Pod: Forward to pod
93
+ NGINX->>Pod: Proxy directly to pod
96
94
Pod->>Pod: Process request
97
- Pod->>Service: Return response
98
- Service->>NGINX: Response
95
+ Pod->>NGINX: Return response
99
96
NGINX->>User: HTTP Response
100
97
```
101
98
102
99
## Request Routing Logic
103
100
104
- ### Path-Based Routing
105
-
106
- ``` nginx
107
- # Generated from HTTPRoute resources
108
- location /users {
109
- proxy_pass http://user-service;
110
- }
111
-
112
- location /orders {
113
- proxy_pass http://order-service;
114
- }
115
-
116
- location /products {
117
- proxy_pass http://product-service;
118
- }
119
- ```
120
-
101
+ Routes use both hostname and path for traffic routing decisions.
121
102
122
- ### Host-Based Routing
103
+ ### Combined Host and Path Routing
123
104
124
105
``` nginx
125
- # Different hosts route to different services
106
+ # Routes combine hostname and path matching
126
107
server {
127
108
server_name api.example.com;
128
- location / {
129
- proxy_pass http://api-service;
109
+
110
+ location /users {
111
+ proxy_pass http://user-service;
112
+ }
113
+
114
+ location /orders {
115
+ proxy_pass http://order-service;
130
116
}
131
117
}
132
118
133
119
server {
134
120
server_name admin.example.com;
135
- location / {
121
+
122
+ location /dashboard {
136
123
proxy_pass http://admin-service;
137
124
}
125
+
126
+ location /settings {
127
+ proxy_pass http://config-service;
128
+ }
138
129
}
139
130
```
0 commit comments