Shiny apps fail in Microsoft Edge with status 400

Update: For me, the issue was that the rewrite rules for some reason was outside my <VirtualHost></VirtualHost>. This did not affect Chrome or IE, but Edge gave a 400. The following rules work on Edge on Shiny server 1.5.6.875.

<Proxy *>
   Allow from localhost
</Proxy>

RewriteEngine on
RewriteRule ^/shiny$ /shiny/ [R]
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /shiny/(.*) ws://localhost:3838/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /shiny/(.*) http://localhost:3838/$1 [P,L]

ProxyPreserveHost On
ProxyPass /shiny/ http://localhost:3838/
ProxyPassReverse /shiny/ http://localhost:3838/