Skip to content

Commit

Permalink
Merge pull request #1451 from aledbf/fix-links
Browse files Browse the repository at this point in the history
Add example of server-snippet
  • Loading branch information
aledbf authored Sep 30, 2017
2 parents 99c85f3 + ad6ef7d commit cbb703c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions controllers/nginx/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following annotations are supported:
|[ingress.kubernetes.io/rewrite-target](#rewrite)|URI|
|[ingress.kubernetes.io/secure-backends](#secure-backends)|true or false|
|[ingress.kubernetes.io/server-alias](#server-alias)|string|
|[ingress.kubernetes.io/server-snippet](#server-snippet)|string|
|[ingress.kubernetes.io/service-upstream](#service-upstream)|true or false|
|[ingress.kubernetes.io/session-cookie-name](#cookie-affinity)|string|
|[ingress.kubernetes.io/session-cookie-hash](#cookie-affinity)|string|
Expand Down Expand Up @@ -191,6 +192,29 @@ the new server configuration will take place over the alias configuration.

For more information please see http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name

### Server snippet

Using the annotation `ingress.kubernetes.io/server-snippet` it is possible to add custom configuration in the server configuration block.

```
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/server-snippet: |
set $agentflag 0;
if ($http_user_agent ~* "(Mobile)" ){
set $agentflag 1;
}
if ( $agentflag = 1 ) {
return 301 https://m.example.com;
}
```

**Important:** This annotation can be used only once per host

### Client Body Buffer Size

Sets buffer size for reading client request body per location. In case the request body is larger than the buffer,
Expand Down

0 comments on commit cbb703c

Please sign in to comment.