关于 apache反代后 websocket 问题,网页无法正常工作
本帖最后由 Exploit-db 于 2022-1-15 17:38 编辑我在我的家庭主机中安装了一个 NAS,我还为一个名为 V2rayA 的项目(dddd)使用了 apache 反向代理。现在在公网上,可以正常访问网页了。出现报错。浏览器控制台报错如下app.c3cf58cb.js:1 WebSocket connection to 'wss://www.exm.com:444/api/message?Authorization=undefined' failed: 我知道这是未设置 websocket 的原因,但我是新手,我无法修复它。如何设置我的 websocket。能否给个例子<VirtualHost *:443>
SSLProxyEngine on
ServerAdmin webmaster@localhost
DocumentRoot /var/www/nextcloud
SSLEngine on
SSLCertificateFile/home/exploit/Apache/1.pem
SSLCertificateKeyFile /home/exploit/Apache/1_key.key
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
ProxyPass /v2ray/ http://127.0.0.1:2017/
ProxyPassReverse /v2ray/ http://127.0.0.1:2017/
ProxyPass /api/ws://127.0.0.1:2017/api/
ProxyPass /api/wss://127.0.0.1:2017/api/</VirtualHost>
控制台其他报错如下
----------------------------------------------------------------------------------
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
---------------------------------------------------------------------------
Uncaught (in promise) Error: Request failed with status code 500 at t.exports (chunk-vendors.7f573ede.js:1:294975) at t.exports (chunk-vendors.7f573ede.js:1:322560) at XMLHttpRequest.h.onreadystatechange (chunk-vendors.7f573ede.js:1:533464)
页:
[1]