Skip to content

Commit 3ee65f6

Browse files
authored
ClientSettingsPolicy Enhancement Proposal (#1692)
Problem: Need design for specifying client settings like client_max_body_size Solution: Add enhancement proposal introducing ClientSettingsPolicy.
1 parent 25cc818 commit 3ee65f6

18 files changed

+450
-2
lines changed

docs/developer/mapping.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Mapping Gateway API Resources to NGINX Contexts
2+
3+
This document shows how NGINX Gateway Fabric maps Gateway API resources to NGINX contexts. Below are the three types of possible mappings (simplified for brevity):
4+
5+
**A. Distinct Hostnames**
6+
7+
![map-a](/docs/images/mapping/mapping-a.png)
8+
9+
When each HTTPRoute attached to a Gateway has a distinct set of hostnames, NGINX Gateway Fabric will generate a server block for each hostname. All the locations contained in the server block belong to a single HTTPRoute.
10+
In this scenario, each server block is "owned" by a single HTTPRoute.
11+
12+
> Note: This mapping only applies to "Exact" path matches. Some "PathPrefix" path matches will generate an additional location block to handle prefix matching.
13+
14+
**B. Same Hostname**
15+
16+
![map-b](/docs/images/mapping/mapping-b.png)
17+
18+
When HTTPRoutes attached to a Gateway specify the same hostname, NGINX Gateway Fabric generates a single server block containing the locations from all HTTPRoutes that specify the server's hostname.
19+
In this scenario, the HTTPRoutes share "ownership" of the server block.
20+
21+
**C. Internal Redirect**
22+
23+
![map-c](/docs/images/mapping/mapping-c.png)
24+
25+
When HTTPRoutes attached to a Gateway specify the same hostname _and_ path, NGINX Gateway Fabric will generate a single server block and a single (external) location for that path. In addition, it will generate one named location block -- only used for internal requests -- per HTTPRoute match rule.
26+
The external location will offload the routing decision to an NGINX JavaScript (NJS) function that will route the request to the appropriate named location.
27+
In this scenario, the HTTPRoutes share "ownership" of the server block and the external location block.
15.4 KB
Loading
12.1 KB
Loading
97.9 KB
Loading
95.2 KB
Loading
76.2 KB
Loading
125 KB
Loading
85.6 KB
Loading
69.9 KB
Loading
118 KB
Loading
95.2 KB
Loading
82 KB
Loading
126 KB
Loading

docs/images/mapping/mapping-a.png

58.5 KB
Loading

docs/images/mapping/mapping-b.png

54.3 KB
Loading

docs/images/mapping/mapping-c.png

63.5 KB
Loading

docs/proposals/client-settings.md

Lines changed: 422 additions & 0 deletions
Large diffs are not rendered by default.

docs/proposals/nginx-extensions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ NGINX directives:
718718
- [`keepalive_requests`](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests)
719719
- [`keepalive_time`](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_time)
720720
- [`keepalive_timeout`](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout)
721-
- [`keepalive_disable`](https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable)
722721

723722
These features are grouped because they all deal with client traffic.
724723

@@ -731,7 +730,7 @@ An Inherited Policy fits this group best for the following reasons:
731730

732731
#### Future Work
733732

734-
- Can add support for more `client_*` directives: `client_body_buffer_size`, `client_header_buffer_size`, etc.
733+
- Can add support for more `client_*` directives: `client_body_buffer_size`, `client_header_buffer_size`, `keepalive_disable`, etc.
735734

736735
#### Alternatives
737736

0 commit comments

Comments
 (0)