apache - 从 Apache 代理反向中的重定向 URL 传递多个参数
问题描述
我正在运行一个利用laravel-echo-server的应用程序。因此,为了让我在生产服务器上运行它,https
我需要使用 apache 代理反向将我的/tools/socket.io/
url 重定向到http://localhost:6001
.
虽然这工作正常,但我一直收到此错误Cannot Post /
,因为我需要将参数从我的域 url 传递到我的反向代理 url。这是我的 apache 配置:
ProxyPreserveHost On
ProxyRequests off
ProxyPass /tools/socket.io/ http://localhost:6001/
ProxyPassReverse /tools/socket.io/ http://localhost:6001/
我遇到了这个帖子堆栈溢出,但实现对我不起作用。
所以这是我需要传递的参数,它们的值是动态的EIO
transport
t
。我的网址就像
https://exampledomain.com/tools/socket.io/?EIO=3&transport=polling&t=Ml8lZDJ
解决方案
这是我的域的 SSL 虚拟主机中的 apaxhe 配置:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:6001/$1 [P,L]
ProxyPass /socket.io http://localhost:6001/socket.io
ProxyPassReverse /socket.io http://localhost:6001/socket.io
推荐阅读
- javascript - Javascript XMLHttpRequest 鼠标悬停事件监听器
- gradle - 导入 coroutines-common 会导致错误“无法将 JVM 目标 1.8 的内联字节码构建到...”。即使明确指定了 jvmTarget
- react-native - 为什么在为 redux 操作运行测试时不调用来自 __mock__ 文件夹的模拟?
- javascript - 如何修复errorerror试图在sql中更新表
- jquery - 是否可以让 $.ajax 返回一个值,比如函数?
- java - 如何提高从 hazelcast 读取数据的 Get 方法性能?
- c# - 我可以检查一个字符串中是否包含数组的元素吗?
- c++ - 为什么当 static_cast(ing) 一个函数为 void* 时编译器的行为会有所不同?
- python - 如果没有“。”,如何返回 true 在同一字符串中的“xyz”之前
- c - 作业:C 编程中的数组拆分