From 14e095b56980bcf752a80c484fb58bb7e9dbdcaf Mon Sep 17 00:00:00 2001 From: Zoey Date: Fri, 23 Dec 2022 00:25:32 +0100 Subject: [PATCH] try to close #1314 Got it from: https://stackoverflow.com/a/41388585 & https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html In my test, it works Signed-off-by: Zoey --- reverse-proxy.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reverse-proxy.md b/reverse-proxy.md index c41193b0..475345a3 100644 --- a/reverse-proxy.md +++ b/reverse-proxy.md @@ -46,10 +46,11 @@ Add this as a new Apache site config: RewriteEngine On ProxyPreserveHost On AllowEncodedSlashes NoDecode - ProxyPass / http://localhost:11000/ + ProxyPass / http://localhost:11000/ nocanon RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] - RewriteRule ^/?(.*) "ws://localhost:11000/$1" [P,QSA,B=?:;] + RewriteCond %{THE_REQUEST} "^[a-zA-Z]+ /(.*) HTTP/\d+(\.\d+)?$" + RewriteRule .? "ws://localhost:11000/%1" [P,L] # Enable h2, h2c and http1.1 Protocols h2 h2c http/1.1