From fd196e5d6b1142ba1bf1d409e37b0f2bb233d9db Mon Sep 17 00:00:00 2001
From: MichiK <michik@michik.net>
Date: Wed, 23 Dec 2020 17:53:44 +0100
Subject: [PATCH] Really fix nging config and unify config notation

---
 host_vars/gabriel.c3heaven.de | 52 +++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 18 deletions(-)

diff --git a/host_vars/gabriel.c3heaven.de b/host_vars/gabriel.c3heaven.de
index 5e74e8e..5ffcce7 100644
--- a/host_vars/gabriel.c3heaven.de
+++ b/host_vars/gabriel.c3heaven.de
@@ -17,21 +17,27 @@ nginx_https_sites:
  - name: "c3heaven.de"
    locations:
     - location: "/"
-      config: "root {{ website_deployment_path }};"
-    - location: "/img/"
-      config: "add_header Access-Control-Allow-Origin *;"
-    - location: "~ /(.*)_galf_tseuq.html$"
-      config: "add_header Access-Control-Allow-Origin *;"
+      config: |-
+          root {{ website_deployment_path }};
+          location /img/ {
+            add_header Access-Control-Allow-Origin *;
+          }
+          location ~ /(.*)_galf_tseuq.html$ {
+            add_header Access-Control-Allow-Origin *;
+          }
     - location: "~ /wiki(.*)$"
-      config: "return 301 https://wiki.c3heaven.de$1?$args;"
+      config: |-
+          return 301 https://wiki.c3heaven.de$1?$args;
     - location: "~ /kanboard(.*)$"
-      config: "return 301 https://kanboard.c3heaven.de$1?$args;"
+      config: |-
+          return 301 https://kanboard.c3heaven.de$1?$args;
     - location: "/guide"
       config: |-
           alias {{ angelguide_deployment_path }};
           add_header Access-Control-Allow-Origin *;
     - location: "/angelguide.pdf"
-      config: "rewrite .* /guide/angelguide_$lang.pdf;"
+      config: |-
+          rewrite .* /guide/angelguide_$lang.pdf;
     - location: "/favicon.ico"
       config: |-
           access_log off;
@@ -59,7 +65,8 @@ nginx_https_sites:
     - "index index.php;"
    locations:
     - location: "/"
-      config: "try_files $uri $uri/ /index.php$is_args$args;"
+      config: |-
+          try_files $uri $uri/ /index.php$is_args$args;
     - location: '~ \.php$'
       config: |-
         try_files $uri =404;
@@ -69,9 +76,11 @@ nginx_https_sites:
         fastcgi_index index.php;
         include fastcgi_params;
     - location: '~* ^.+\.(log|sqlite)$'
-      config: "return 404;"
+      config: |-
+          return 404;
     - location: '~ /\.ht'
-      config: "return 404;"
+      config: |-
+          return 404;
     - location: '~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$'
       config: |-
         log_not_found off;
@@ -90,9 +99,11 @@ nginx_https_sites:
         fastcgi_intercept_errors on;
         fastcgi_pass unix:/var/run/fcgiwrap.socket;
     - location: "/images/mailman"
-      config: "alias /usr/share/images/mailman;"
+      config: |-
+          alias /usr/share/images/mailman;
     - location: "= /"
-      config: "return 301 https://lists.c3heaven.de/cgi-bin/mailman/listinfo/;"
+      config: |-
+          return 301 https://lists.c3heaven.de/cgi-bin/mailman/listinfo/;
  - name: "md.c3heaven.de"
    locations:
     - location: "/"
@@ -133,7 +144,8 @@ nginx_https_sites:
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_set_header X-Forwarded-Port   443;
     - location: "= /"
-      config: "return 301 https://sso.c3heaven.de/auth/realms/master/account;"
+      config: |-
+          return 301 https://sso.c3heaven.de/auth/realms/master/account;
  - name: "wiki.c3heaven.de"
    options:
     - "client_max_body_size 100M;"
@@ -142,13 +154,17 @@ nginx_https_sites:
     - "index doku.php;"
    locations:
     - location: "~ /(conf/|bin/|inc/|install.php)"
-      config: "deny all;"
+      config: |-
+          deny all;
     - location: "~ ^/data/"
-      config: "internal;"
+      config: |-
+          internal;
     - location: '~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$'
-      config: "expires 365d;"
+      config: |-
+          expires 365d;
     - location: "/"
-      config: "try_files $uri $uri/ @dokuwiki;"
+      config: |-
+          try_files $uri $uri/ @dokuwiki;
     - location: "@dokuwiki"
       config: |-
         rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
-- 
GitLab