尝试通过我的 Apache2 服务器访问 ws://localhost:8080/ 时出现错误 500。该服务器运行 OpenSuse Leap 42.1 和 Apache 2.4.16。
这些 Apache2 模块已启用:mod_proxy、mod_proxy_http、mod_proxy_wstunnel。
当从本地网络调用请求时,一切正常。网址示例:http://<myhost-ip-address>/api/ws/<some-url>
. 它返回状态 101 和响应:Upgrade: websocket
。没关系。
来自外网的同类请求失败。网址示例:ws://www.mysite.com/api/ws/<some-url>
. 它返回错误 500。
Apache 访问日志包含: GET /api/ws/<some-url> HTTP/1.1" 500 ...
Apache 错误日志包含: [proxy:warn] AH01144: No protocol handler was valid for the URL /api/ws/<some-url>. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
我的 httpd.conf:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias mysite.com
# Redirection …
Run Code Online (Sandbox Code Playgroud)