Score:1

Unexpected Upgrade: websocket (expecting n/a)

in flag

https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html clearly states that proxying a websocket is as simple as

ProxyPass "/ws2/"  "ws://echo.websocket.org/"

yet no matter what I do I keep getting

==> /var/log/apache2/domain.com-access_log <==
192.168.240.1 - - [29/Mar/2022:20:46:40 +0000] "GET /url-to-proxy/?query-stuff HTTP/1.1" 502 2554

==> /var/log/apache2/domain.com-error_log <==
[Tue Mar 29 20:46:40.096767 2022] [proxy:error] [pid 56] [client 192.168.240.1:54536] AH00898: Unexpected Upgrade: websocket (expecting n/a) returned by /url-to-proxy/
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
[...]
$ apache2 -v
Server version: Apache/2.4.51 (Debian)
Server built:   2021-10-07T17:49:44

I followed this stackoverflow answer and used

RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
#RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]

ProxyRequests off
#ProxyPass / http://127.0.0.1:3000/
ProxyPass /url-to-proxy/ http://127.0.0.1:3000/
#ProxyPass / ws://127.0.0.1:3000/
#ProxyPass /url-to-proxy/ ws://127.0.0.1:3000/

tried with/without RewriteRule/ProxyRequests off/ProxyPassReverse with 'http' or 'ws' or '/' or '/url-to-proxy/' in ProxyPass but I always get the same error

could this be related: https://bz.apache.org/bugzilla/show_bug.cgi?id=55598 I would like to think a bug from 2016 has been back ported by now to a docker image that is only two months old... (wordpress:5.8.3-php7.4-apache)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.