From 6d1e07d5991380caddaf9b10f781661069e2184c Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 11 May 2022 15:45:14 -0700 Subject: [PATCH] proxies / reverseproxy / openqa: do this in a more sustainable way Signed-off-by: Kevin Fenzi --- .../templates/reversepassproxy.openqa.conf | 43 +------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.openqa.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.openqa.conf index 8abfcaab91..ee26261dfd 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.openqa.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.openqa.conf @@ -1,44 +1,5 @@ -SSLProxyEngine On - - - {% for member in balancer_members %} - {% if http_not_https_yes_this_is_insecure_and_i_feel_bad %} - {% if remotepath is defined and remotepath != "/" %} - BalancerMember "ws://{{ member }}{{ remotepath }}" - {% else %} - BalancerMember "ws://{{ member }}" - {% endif %} - {% else %} - {% if remotepath is defined and remotepath != "/" %} - BalancerMember "wss://{{ member }}{{ remotepath }}" - {% else %} - BalancerMember "wss://{{ member }}" - {% endif %} - {% endif %} - {% endfor %} - - -RewriteEngine on -RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC] -RewriteCond %{HTTP:Connection} Upgrade [NC] -{% if remotepath is defined and remotepath != "/" %} -RewriteCond %{REQUEST_URI} ^{{ remotepath }}/(.)* -{% endif %} -RewriteRule .* "balancer://{{ balancer_name }}-websocket%{REQUEST_URI}" [P] - - - {% for member in balancer_members %} - {% if http_not_https_yes_this_is_insecure_and_i_feel_bad %} - BalancerMember "http://{{ member }}" - {% else %} - BalancerMember "https://{{ member }}" - {% endif %} - {% endfor %} - -{% if datacenter == 'iad2' %} -ProxyPass {{ localpath }} "balancer://{{balancer_name}}{{remotepath}}" -ProxyPassReverse {{ localpath }} "balancer://{{balancer_name}}{{remotepath}}" +{% if 'iad2' in inventory_hostname %} +{% include "reversepassproxy.conf" %} {% else %} Redirect 421 / {% endif %} -