proxies / reverseproxy / openqa: do this in a more sustainable way
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
8d38f818e7
commit
6d1e07d599
1 changed files with 2 additions and 41 deletions
|
@ -1,44 +1,5 @@
|
||||||
SSLProxyEngine On
|
{% if 'iad2' in inventory_hostname %}
|
||||||
|
{% include "reversepassproxy.conf" %}
|
||||||
<Proxy "balancer://{{balancer_name}}-websocket">
|
|
||||||
{% 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 %}
|
|
||||||
</Proxy>
|
|
||||||
|
|
||||||
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]
|
|
||||||
|
|
||||||
<Proxy "balancer://{{balancer_name}}">
|
|
||||||
{% 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 %}
|
|
||||||
</Proxy>
|
|
||||||
{% if datacenter == 'iad2' %}
|
|
||||||
ProxyPass {{ localpath }} "balancer://{{balancer_name}}{{remotepath}}"
|
|
||||||
ProxyPassReverse {{ localpath }} "balancer://{{balancer_name}}{{remotepath}}"
|
|
||||||
{% else %}
|
{% else %}
|
||||||
Redirect 421 /
|
Redirect 421 /
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue