From 48a4119420047b1b86b8e01b3470a3ffb1f6c400 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Mon, 4 Jul 2022 14:01:09 +0200 Subject: [PATCH] Add rewrite rules for websockets --- .../templates/apache-docker-proxy-site.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/setup-http-site-proxy/templates/apache-docker-proxy-site.j2 b/roles/setup-http-site-proxy/templates/apache-docker-proxy-site.j2 index 287cb0e..f81280c 100644 --- a/roles/setup-http-site-proxy/templates/apache-docker-proxy-site.j2 +++ b/roles/setup-http-site-proxy/templates/apache-docker-proxy-site.j2 @@ -33,5 +33,12 @@ RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} + + # see documentation of wstunnel: This allwos generic websocket passthrough + RewriteEngine On + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteRule ^/?(.*) "ws://{{ backend_host | default("localhost") }}:{{ proxy_port }}/$1" [P,L] +