Skip to content

Commit 92fd487

Browse files
committed
Updating docs to include stream snippets
1 parent 1e718fe commit 92fd487

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs-web/configuration/transportserver-resource.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,27 @@ spec:
391391
port: 80
392392
```
393393

394+
Snippets can also be specified for a stream. In the example below, we use snippets to configure [access control](http://nginx.org/en/docs/stream/ngx_stream_access_module.html) and we set the [logging level](http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#limit_conn_zone) for cases when the server limits the number of connections in a TransportServer:
395+
396+
397+
```yaml
398+
apiVersion: k8s.nginx.org/v1alpha1
399+
kind: TransportServer
400+
metadata:
401+
name: cafe
402+
spec:
403+
host: cafe.example.com
404+
streamSnippets: |
405+
limit_conn_log_level info;
406+
serverSnippets: |
407+
deny 192.168.1.1;
408+
allow 192.168.1.0/24;
409+
upstreams:
410+
- name: tea
411+
service: tea-svc
412+
port: 80
413+
```
414+
394415
Snippets are intended to be used by advanced NGINX users who need more control over the generated NGINX configuration.
395416

396417
However, because of the disadvantages described below, snippets are disabled by default. To use snippets, set the [`enable-snippets`](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-enable-snippets) command-line argument.

0 commit comments

Comments
 (0)