]> Frank Brehm's Git Trees - pixelpark/hiera.git/commitdiff
spk: add directory and rewrites
authorAndreas Gerstenberg <gerstenberg@pixelpark.com>
Wed, 16 Aug 2017 12:27:37 +0000 (14:27 +0200)
committerAndreas Gerstenberg <gerstenberg@pixelpark.com>
Wed, 16 Aug 2017 12:27:37 +0000 (14:27 +0200)
customer/spk-spar-checker/test.yaml

index 94f687908208a48567e36c93aba9521aa3939ae9..055a8e7f290909d8a6a56d3b903fc8d0dc05f12e 100644 (file)
@@ -45,7 +45,7 @@ infra::profile::apache::pp_vhosts:
         allow_override:
           - All
         directoryindex: 'index.php index.html'
-      - location1:
+      - location_root:
         provider: location
         path: '/'
         auth_type: Digest
@@ -54,6 +54,71 @@ infra::profile::apache::pp_vhosts:
         auth_digest_algorithm: MD5
         auth_user_file: '/etc/httpd/htdigest'
         auth_require: 'valid-user'
+      - location_api:
+        provider: location
+        path: '/api'
+      - location_sfp:
+        provider: location
+        path: '/sfp'
+        error_documents:
+          - { error_code: 401 , document: "/401.html" }
+
+      - directory_sfp:
+        provider: directory
+        path: '/var/www/spar-checker/sparchecker-backend/public/sfp/'
+        addhandlers:
+          - { handler: "proxy:unix:/var/run/php5-fpm-sparchecker.sock|fcgi://./" , extensions: '.php' }
+        options:
+          - FollowSymLinks
+          - MultiViews
+        allow_override:
+          - All
+        directoryindex: 'index.php index.html'
+        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:
+              - '^(.*)$ %{ENV:BASE}/index.php [L]'
+      
+      - directory_api:
+        provider: directory
+        path: '/var/www/spar-checker/sparchecker-backend/public/api/'
+        addhandlers:
+          - { handler: "proxy:unix:/var/run/php5-fpm-sparchecker.sock|fcgi://./" , extensions: '.php' }
+        options:
+          - FollowSymLinks
+          - MultiViews
+        allow_override:
+          - All
+        directoryindex: 'index.php index.html'
+        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:
+              - '^(.*)$ %{ENV:BASE}/index.php [L]'
+
     headers:
       - 'always set X-XSS-Protection "1; mode=block"'
       - 'always set X-Frame-Options "SAMEORIGIN"'