Make WebSocket possible for (app.)os.stg.fedoraproject.org

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
This commit is contained in:
Patrick Uiterwijk 2018-09-12 01:24:30 +02:00
parent e3e8db31ad
commit b97a401f57
2 changed files with 19 additions and 5 deletions

View file

@ -19,9 +19,23 @@ ProxyPreserveHost On
{% if balancer_name is defined %}
SSLProxyEngine On
{% if env == "staging" %}
<Proxy "balancer://{{balancer_name}}-websocket">
{% for member in balancer_members %}
BalancerMember "wss://{{ member }}"
{% endfor %}
</Proxy>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC]
RewriteCond %{HTTP:Connection} ^Upgrade$ [NC]
RewriteRule .* "balancer://{{ balancer_name }}-websocket%{REQUEST_URI}" [P]
{% endif %}
<Proxy "balancer://{{balancer_name}}">
{% for member in balancer_members %}
BalancerMember "{{ member }}"
BalancerMember "https://{{ member }}"
{% endfor %}
</Proxy>
ProxyPass {{ localpath }} "balancer://{{balancer_name}}{{remotepath}}"