Hi i’m searching for a way to reverse proxy a Website with Websocket with apache2 but the Website and the Reverse Proxy are running on different Isolated servers.
I’ve tried the normal way to configure it but my setup is not working.
<VirtualHost *:443>
ServerName domain
ProxyPreserveHost On
ProxyRequests off
<Location />
ProxyPass http://ip:80/
ProxyPassReverse http://ip:80/
</Location>
<Location /sub>
ProxyPass wss://ip:443/
ProxyPassReverse wss://ip:443/
</Location>
RewriteEngine on
RewriteRule ^/\.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^/\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
RewriteRule ^/\.well-known/webfinger /index.php/.well-known/webfinger [R=301,L]
RewriteRule ^/\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^/\.well-known/caldav /remote.php/dav/ [R=301,L]
RewriteRule ^/\.well-known/nodeinfo /index.php/.well-known/nodeinfo [R=301,L]
RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteRule .* "wss:/ip:443/$1" [P,L]
Protocols h2 http/1.1
Header always set Strict-Transport-Security: "max-age=63072000; includeSubDomains; preload"
Header set Content-Security-Policy "frame-ancestors 'self';"
SSLEngine on
SSLProtocol all -SSLv3 +TLSv1.2 +TLSv1.3
SSLHonorCipherOrder on
SSLSessionTickets off
SSLUseStapling on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLCertificateFile /etc/letsencrypt/live/cert/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cert/privkey.pem
</VirtualHost>
eror log apache:
[Wed May 10 16:31:11.198085 2023] [proxy:error] [pid 54233:tid 139683125876288] (111)Connection refused: AH00957: wss: attempt to connect to ip:443 (ip:443) failed
[Wed May 10 16:31:11.198130 2023] [proxy_http:error] [pid 54233:tid 139683125876288] [client ip:52037] AH01114: HTTP: failed to make connection to backend: ip