]> Frank Brehm's Git Trees - pixelpark/hiera.git/commitdiff
spk-spar-checker modify rewrites
authorAndreas Gerstenberg <gerstenberg@pixelpark.com>
Mon, 16 Oct 2017 12:34:09 +0000 (14:34 +0200)
committerAndreas Gerstenberg <gerstenberg@pixelpark.com>
Mon, 16 Oct 2017 12:34:09 +0000 (14:34 +0200)
customer/spk-spar-checker/production.yaml
customer/spk-spar-checker/test.yaml

index 98d67ccf0304a154cf765da27bb7ccd16590ea06..23c81987f55a768e1a8d76e79cd74d483e2267bf 100644 (file)
@@ -67,6 +67,37 @@ infra::profile::apache::pp_vhosts:
         allow_override:
           - None
         directoryindex: 'index.html'
+# neu
+        custom_fragment: 'AddType text/plain .tmpl'
+        rewrites:
+          - comment: 'frontend root rewrite'
+            rewrite_cond:
+              - '%{REQUEST_URI} ^/$'
+            rewrite_rule:
+              - '.* /index.html [END]'
+          - comment: 'frontend rewrites'
+            rewrite_rule:
+              - '^code/(modernizr-custom.js|spar-checker-min.css|spar-checker-min.js|selection.json)$  - [L]'
+              - '^code/(modernizr-custom|spar-checker-min|selection)-v[0-9]{1,4}\.(js|css|json)$ /code/$1.$2  [END]'
+              - '^media/(.*)-v[0-9]{1,4}\.(svg|jpg|png|gif)$ /media/$1.$2 [END]'
+              - '^media/(.*)\.(svg|jpg|png|gif)$ - [L]'
+              - '^code/.*\.(tmpl|eot|svg|ttf|woff|woff2)$  - [L]'
+              - '^((401|403|404|500)\.html)$ - [L]'
+              - '^(favicon-[0-9]{2}.ico)$ - [L]'
+              - '^(favicon-[0-9]{2}x[0-9]{2}.png)$ - [L]'
+              - '^(favicon.ico)$ - [L]'
+              - '^(sitemap.xml)$ - [L]'
+              - '^(robots.txt)$ - [L]'
+              - '^(manifest.json)$ - [L]'
+              - '^(browserconfig.xml)$ - [L]'
+              - '^(android-chrome-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(apple-touch-icon-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(apple-touch-icon-precompose.png)$ - [L]'
+              - '^(apple-touch-icon.png)$ - [L]'
+              - '^(mstile-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(opera_160.png)$ - [L]'
+              - '.* /404.html [R=404,L]'
+
       - provider: location
         path: '/'
         limit_except:
@@ -103,27 +134,31 @@ infra::profile::apache::pp_vhosts:
           - FollowSymLinks
         allow_override:
           - None
-        directoryindex: 'index.php index.html'
-      - provider: filesmatch
-        path: '\.(ttf|otf|eot|woff)$'
-        headers:
-          - 'always set Access-Control-Allow-Origin "*"'
+        directoryindex: 'index.php'
+# alt
+#        rewrites:
+#          - comment: 'sfp files'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
+#            rewrite_rule:
+#              - '^.*$ - [L]'
+#          - comment: 'sfp rebase'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+#            rewrite_rule:
+#              - '^(.*) - [E=BASE:%1]'
+#          - comment: 'sfp index'
+#            rewrite_rule:
+#              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+# neu
         rewrites:
-          - comment: 'sfp files'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
-            rewrite_rule:
-              - '^.*$ - [L]'
-          - comment: 'sfp rebase'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+          - comment: 'sfp rewrites'
             rewrite_rule:
-              - '^(.*) - [E=BASE:%1]'
-          - comment: 'sfp index'
-            rewrite_rule:
-              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+              - 'code/.*(css|js|eot|index.php|svg|ttf|woff|woff2)$  - [L]'
+              - '.* /sfp/index.php [END]'
+
       - provider: directory
         path: '/var/www/spar-checker/sparchecker-backend/public/api/'
         addhandlers:
@@ -132,23 +167,34 @@ infra::profile::apache::pp_vhosts:
           - FollowSymLinks
         allow_override:
           - None
-        directoryindex: 'index.php index.html'
+        directoryindex: 'index.php'
+#        rewrites:
+#          - comment: 'api files'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
+#            rewrite_rule:
+#              - '^.*$ - [L]'
+#          - comment: 'api rebase'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+#            rewrite_rule:
+#              - '^(.*) - [E=BASE:%1]'
+#          - comment: 'api index'
+#            rewrite_rule:
+#              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+# neu
         rewrites:
-          - comment: 'api files'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
-            rewrite_rule:
-              - '^.*$ - [L]'
-          - comment: 'api rebase'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
-            rewrite_rule:
-              - '^(.*) - [E=BASE:%1]'
-          - comment: 'api index'
+          - comment: 'api rewrites'
             rewrite_rule:
-              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+              - '^v1/[/[:alnum:]]{2,30}$ /api/index.php [END]'
+              - '.* /404.html [R=404,L]'
+
+      - provider: filesmatch
+        path: '\.(ttf|otf|eot|woff)$'
+        headers:
+          - 'always set Access-Control-Allow-Origin "*"'
     rewrites:
       - comment: 'Alle Aliase auf Servername'
         rewrite_cond:
index ab08ff7a07316d77aa0f8f18b93106480ed0e1e1..bc8e6f8407b52a9d172853bafbd6dc833e2a8ddf 100644 (file)
@@ -51,6 +51,7 @@ infra::profile::apache::pp_vhosts:
       - 'HTTPS on HTTPS=on'
       - 'X-Forwarded-For ^80.146.239.2 admin_ip_range'
       - 'X-Forwarded-For 192.168.15.1[89] admin_ip_range'
+      - 'X-Forwarded-For 130.180.83.190 admin_ip_range'
     error_documents:
       - { error_code: 401 , document: "/401.html" }
       - { error_code: 403 , document: "/403.html" }
@@ -64,6 +65,37 @@ infra::profile::apache::pp_vhosts:
         allow_override:
           - None
         directoryindex: 'index.html'
+# neu
+        custom_fragment: 'AddType text/plain .tmpl'
+        rewrites:
+          - comment: 'frontend root rewrite'
+            rewrite_cond:
+              - '%{REQUEST_URI} ^/$'
+            rewrite_rule:
+              - '.* /index.html [END]'
+          - comment: 'frontend rewrites'
+            rewrite_rule:
+              - '^code/(modernizr-custom.js|spar-checker-min.css|spar-checker-min.js|selection.json)$  - [L]'
+              - '^code/(modernizr-custom|spar-checker-min|selection)-v[0-9]{1,4}\.(js|css|json)$ /code/$1.$2  [END]'
+              - '^media/(.*)-v[0-9]{1,4}\.(svg|jpg|png|gif)$ /media/$1.$2 [END]'
+              - '^media/(.*)\.(svg|jpg|png|gif)$ - [L]'
+              - '^code/.*\.(tmpl|eot|svg|ttf|woff|woff2)$  - [L]'
+              - '^((401|403|404|500)\.html)$ - [L]'
+              - '^(favicon-[0-9]{2}.ico)$ - [L]'
+              - '^(favicon-[0-9]{2}x[0-9]{2}.png)$ - [L]'
+              - '^(favicon.ico)$ - [L]'
+              - '^(sitemap.xml)$ - [L]'
+              - '^(robots.txt)$ - [L]'
+              - '^(manifest.json)$ - [L]'
+              - '^(browserconfig.xml)$ - [L]'
+              - '^(android-chrome-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(apple-touch-icon-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(apple-touch-icon-precompose.png)$ - [L]'
+              - '^(apple-touch-icon.png)$ - [L]'
+              - '^(mstile-[0-9]{2,3}x[0-9]{2,3}.png)$ - [L]'
+              - '^(opera_160.png)$ - [L]'
+              - '.* /404.html [R=404,L]'
+
       - provider: location
         path: '/'
         limit_except:
@@ -78,8 +110,6 @@ infra::profile::apache::pp_vhosts:
           requires:
             - 'valid-user'
             - 'env admin_ip_range'
-#      - provider: location
-#        path: '/api'
       - provider: location
         path: '/sfp'
         auth_type: Digest
@@ -100,23 +130,31 @@ infra::profile::apache::pp_vhosts:
           - FollowSymLinks
         allow_override:
           - None
-        directoryindex: 'index.php index.html'
+        directoryindex: 'index.php'
+# alt
+#        rewrites:
+#          - comment: 'sfp files'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
+#            rewrite_rule:
+#              - '^.*$ - [L]'
+#          - comment: 'sfp rebase'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+#            rewrite_rule:
+#              - '^(.*) - [E=BASE:%1]'
+#          - comment: 'sfp index'
+#            rewrite_rule:
+#              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+# neu
         rewrites:
-          - comment: 'sfp files'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
-            rewrite_rule:
-              - '^.*$ - [L]'
-          - comment: 'sfp rebase'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+          - comment: 'sfp rewrites'
             rewrite_rule:
-              - '^(.*) - [E=BASE:%1]'
-          - comment: 'sfp index'
-            rewrite_rule:
-              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+              - 'code/.*(css|js|eot|index.php|svg|ttf|woff|woff2)$  - [L]'
+              - '.* /sfp/index.php [END]'
+
       - provider: directory
         path: '/var/www/spar-checker/sparchecker-backend/public/api/'
         addhandlers:
@@ -125,23 +163,31 @@ infra::profile::apache::pp_vhosts:
           - FollowSymLinks
         allow_override:
           - None
-        directoryindex: 'index.php index.html'
+        directoryindex: 'index.php'
+# alt
+#        rewrites:
+#          - comment: 'api files'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
+#              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
+#            rewrite_rule:
+#              - '^.*$ - [L]'
+#          - comment: 'api rebase'
+#            rewrite_cond:
+#              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
+#            rewrite_rule:
+#              - '^(.*) - [E=BASE:%1]'
+#          - comment: 'api index'
+#            rewrite_rule:
+#              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+# neu
         rewrites:
-          - comment: 'api files'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_FILENAME} -s [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -l [OR]'
-              - '%%{ich-trickse}{REQUEST_FILENAME} -d'
+          - comment: 'api rewrites'
             rewrite_rule:
-              - '^.*$ - [L]'
-          - comment: 'api rebase'
-            rewrite_cond:
-              - '%%{ich-trickse}{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$'
-            rewrite_rule:
-              - '^(.*) - [E=BASE:%1]'
-          - comment: 'api index'
-            rewrite_rule:
-              - '^(.*)$ %%{ich-trickse}{ENV:BASE}/index.php [L]'
+              - '^v1/[/[:alnum:]]{2,30}$ /api/index.php [END]'
+              - '.* /404.html [R=404,L]'
+
       - provider: filesmatch
         path: '\.(ttf|otf|eot|woff)$'
         headers: