Add rewrite rules for websockets

This commit is contained in:
Stefan Haun 2022-07-04 14:01:09 +02:00
parent 45206f4413
commit 48a4119420

View file

@ -33,5 +33,12 @@
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS}
<ifmodule mod_rewrite.c>
# 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]
</ifmodule>
</VirtualHost>
</IfFile>