From ae2e9f0217822df1134f747ae8b62f9059814bce Mon Sep 17 00:00:00 2001 From: semidark Date: Thu, 29 Aug 2024 16:32:08 -0300 Subject: [PATCH] Add WebSocket Support to Apache The current version of Open-WebUI requires WebSockets to function properly. Without the new additions from this latest commit, you will encounter non-recoverable errors in chats, such as [object Object]. --- docs/tutorial/apache.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/tutorial/apache.md b/docs/tutorial/apache.md index 07947cd..f7e4b1f 100644 --- a/docs/tutorial/apache.md +++ b/docs/tutorial/apache.md @@ -27,6 +27,10 @@ For the UI configuration, you can set up the Apache VirtualHost as follows: ProxyPass / http://server.com:3000/ nocanon ProxyPassReverse / http://server.com:3000/ + RewriteEngine on + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteRule ^/?(.*) "ws://server.com:3000/$1" [P,L] ``` @@ -48,6 +52,11 @@ _Normally, mod_proxy will canonicalise ProxyPassed URLs. But this may be incompa ProxyPass / http://server.com:3000/ nocanon ProxyPassReverse / http://server.com:3000/ + RewriteEngine on + RewriteCond %{HTTP:Upgrade} websocket [NC] + RewriteCond %{HTTP:Connection} upgrade [NC] + RewriteRule ^/?(.*) "ws://server.com:3000/$1" [P,L] + SSLEngine on SSLCertificateFile /etc/ssl/virtualmin/170514456861234/ssl.cert SSLCertificateKeyFile /etc/ssl/virtualmin/170514456861234/ssl.key