- 引入mod_proxy_wstunnel.so模块,使其可以解析ws、wss协议
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
- 配置代理路径跳转
Include conf/vhosts.conf
<VirtualHost *:80>
ServerName yangkl-test.com
ServerAlias *.yangkl-test.com
ProxyPass "/shentb/websocket" "ws://127.0.0.1:8080/shentb/websocket"
ProxyPass "/shentb/" "http://127.0.0.1:8080/shentb/"
ProxyPass "/seller/" "http://127.0.0.1:8080/seller/"
ProxyPass "/master/" "http://127.0.0.1:8080/master/"
ProxyPass "/history/" "http://127.0.0.1:8080/history/"
DocumentRoot "E:\phpStudy\WWW\shentb"
<Directory "E:\phpStudy\WWW\shentb">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
本文介绍如何在Apache服务器中引入mod_proxy_wstunnel.so模块,以支持WS和WSS协议的代理转发。通过详细配置示例,展示了如何设置虚拟主机,代理特定路径至本地不同端口的服务,并配置目录权限。

460

被折叠的 条评论
为什么被折叠?



