Fix yaml indentation in server-snippet doc
Copy / Pasting the code made errors when injecting config in kubernetes cluster. With this change, annotations now works in ingresses metadata.
This commit is contained in:
parent
d9f58144eb
commit
6d9977b622
1 changed files with 9 additions and 9 deletions
|
@ -295,15 +295,15 @@ kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/server-snippet: |
|
nginx.ingress.kubernetes.io/server-snippet: |
|
||||||
set $agentflag 0;
|
set $agentflag 0;
|
||||||
|
|
||||||
if ($http_user_agent ~* "(Mobile)" ){
|
if ($http_user_agent ~* "(Mobile)" ){
|
||||||
set $agentflag 1;
|
set $agentflag 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $agentflag = 1 ) {
|
if ( $agentflag = 1 ) {
|
||||||
return 301 https://m.example.com;
|
return 301 https://m.example.com;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! attention
|
!!! attention
|
||||||
|
|
Loading…
Reference in a new issue