You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains the YAML files used in the [SnippetsFilter](https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/snippets-filters/) guide.
3
+
This directory contains the YAML files used in the [Use the SnippetsFilter API](https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/snippets-filters/) guide.
Copy file name to clipboardExpand all lines: site/content/how-to/traffic-management/snippets-filters.md
+30-22Lines changed: 30 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
---
2
-
title: "Snippets Filters"
2
+
title: "Use the SnippetsFilter API"
3
3
weight: 800
4
4
toc: true
5
5
docs: "DOCS-000"
6
6
---
7
7
8
-
Learn how to use Snippets with the `SnippetsFilter` API.
8
+
This topic introduces Snippets and how to implement them using the `SnippetsFilter` API. It provides an example of how to use a Snippet for rate limiting, and how to investigate errors caused by misconfiguration.
Snippets are for advanced NGINX users who need more control over the generated NGINX configuration,
16
18
and can be used in cases where Gateway API resources or NGINX extensions don't apply.
17
19
20
+
---
21
+
18
22
## Disadvantages of Snippets
19
23
20
24
Snippets are configured using the `SnippetsFilter` API, but are disabled by default due to their complexity and security implications.
@@ -23,11 +27,11 @@ To use Snippets, set the `nginxGateway.snippetsFilters.enable` command line argu
23
27
24
28
Snippets have the following disadvantages:
25
29
26
-
-*Complexity*. Snippets require you to:
27
-
- Understand NGINX Configuration primitives and implement a correct NGINX configuration.
30
+
-_Complexity_. Snippets require you to:
31
+
- Understand NGINX configuration primitives to implement correct NGINX configuration.
28
32
- Understand how NGINX Gateway Fabric generates NGINX configuration so that a Snippet doesn’t interfere with the other features in the configuration.
29
-
-*Decreased robustness*. An incorrect Snippet can invalidate NGINX configuration, causing reload failures. Until the snippet is fixed, it will prevent any new configuration updates, including updates for the other Gateway resources.
30
-
-*Security implications*. Snippets give access to NGINX configuration primitives, which are not validated by NGINX Gateway Fabric. For example, a Snippet can configure NGINX to serve the TLS certificates and keys used for TLS termination for Gateway resources.
33
+
-_Decreased robustness_. An incorrect Snippet can invalidate NGINX configuration, causing reload failures. Until the snippet is fixed, it will prevent any new configuration updates, including updates for the other Gateway resources.
34
+
-_Security implications_. Snippets give access to NGINX configuration primitives, which are not validated by NGINX Gateway Fabric. For example, a Snippet can configure NGINX to serve the TLS certificates and keys used for TLS termination for Gateway resources.
31
35
32
36
{{< note >}} If the NGINX configuration includes an invalid Snippet, NGINX will continue to operate with the last valid configuration. {{< /note >}}
33
37
@@ -47,7 +51,7 @@ Due to the described disadvantages of Snippets, we recommend exhausting all othe
47
51
GW_PORT=<port number>
48
52
```
49
53
50
-
{{< note >}}In a production environment, you should have a DNS record for the external IP address that is exposed, and it should refer to the hostname that the gateway will forward for.{{< /note >}}
54
+
{{< note >}}In a production environment, you should have a DNS record for the external IP address that is exposed, and it should refer to the hostname that the gateway will forward for.{{< /note >}}
51
55
52
56
- Create the coffee and tea example applications:
53
57
@@ -77,7 +81,7 @@ Due to the described disadvantages of Snippets, we recommend exhausting all othe
0 commit comments