From f5251cef627494624c9e2261b812b0e40add195c Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 26 Feb 2019 15:21:07 +0100 Subject: [PATCH] new: [apache] added ``apache-proxy-path-options`` to allow adding custom options to ``ProxyPass`` line. --- apache/lib/common | 8 ++++++-- apache/test/vhost | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apache/lib/common b/apache/lib/common index 73247e8..617b50b 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -678,9 +678,13 @@ target-get() { } __vhost_proxy_statement() { - local protocol="$1" cfg="$2" dest="$3" + local protocol="$1" cfg="$2" dest="$3" proxy_pass_options target target=$(target-get "$cfg") || return 1 + proxy_pass_options=($(e "$cfg" | shyaml -y -q get-value apache-proxy-pass-options | yaml_get_values)) + if [ "${#proxy_pass_options[@]}" == 0 ]; then + proxy_pass_options=(${proxy_pass_options:-"retry=0"}) + fi cat < ProxyVia On - ProxyPass / http://$target/ retry=0 + ProxyPass / http://$target/ ${proxy_pass_options[*]} $(__vhost_creds_statement "$cfg" "$dest" | prefix " ") ProxyPassReverse / diff --git a/apache/test/vhost b/apache/test/vhost index 58e150d..ebcd4f7 100644 --- a/apache/test/vhost +++ b/apache/test/vhost @@ -172,6 +172,16 @@ is out part ' ' + +try " +apache_vhost_statement web_proxy ,http, ' +target: popo:3333 +apache-proxy-pass-options: nocanon +' www.example.com +" "proxy proxy-pass options" +noerror +is out reg 'ProxyPass / http://popo:3333/ nocanon' + ## ## ssl ##