From 6d9977b62229d2ce954adc73c61daec051979c32 Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 3 Oct 2018 19:31:14 +0200 Subject: [PATCH] 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. --- .../nginx-configuration/annotations.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/user-guide/nginx-configuration/annotations.md b/docs/user-guide/nginx-configuration/annotations.md index 5476554fa..3a7b55dd5 100644 --- a/docs/user-guide/nginx-configuration/annotations.md +++ b/docs/user-guide/nginx-configuration/annotations.md @@ -295,15 +295,15 @@ kind: Ingress metadata: annotations: nginx.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; -} + set $agentflag 0; + + if ($http_user_agent ~* "(Mobile)" ){ + set $agentflag 1; + } + + if ( $agentflag = 1 ) { + return 301 https://m.example.com; + } ``` !!! attention