From 49b5e34d71cf6c103a49d59df28631beda3e6df8 Mon Sep 17 00:00:00 2001 From: Andreas Gerstenberg Date: Wed, 16 Aug 2017 14:27:37 +0200 Subject: [PATCH] spk: add directory and rewrites --- customer/spk-spar-checker/test.yaml | 67 ++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/customer/spk-spar-checker/test.yaml b/customer/spk-spar-checker/test.yaml index 94f68790..055a8e7f 100644 --- a/customer/spk-spar-checker/test.yaml +++ b/customer/spk-spar-checker/test.yaml @@ -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"' -- 2.39.5