我正在尝试使用 Apache 2 创建一个 SSL 代理,该代理在端口 443 上侦听并根据上下文在不同的 IP/端口上转发请求:
设想:
发出 jBoss“https-remoting”请求(它使用 HTTP1.1 在 Wildfly 8.2 中升级为“jboss-remoting”),来自:
https://xxxxxxx.com:443
并将其转发至:
http://192.168.x.y:8080
我发现以下 RewriteCond 有效:
RewriteCond %{HTTP:Upgrade} jboss-remoting [NC]
RewriteRule ^/(.*)$ http://192.168.x.y:8080/$1 [P]
但我不知道我应该应用什么 RewriteRule 才能请求继续进行 http-remoting 而不是 http。
阿帕奇输入:
GET / HTTP/1.1\r\n
Sec-JbossRemoting-Key: WJaD+AcnutfrXiBna+KL5w==\r\n
Upgrade: jboss-remoting\r\n
Host: xxxxxxx.com\r\n
Connection: upgrade\r\n
阿帕奇输出:
GET / HTTP/1.1\r\n
Host: xxxxxxx.com\r\n
Sec-JbossRemoting-Key: WJaD+AcnutfrXiBna+KL5w==\r\n
X-Forwarded-For: 192.168.x.y\r\n
X-Forwarded-Host: xxxxxxx.com\r\n
X-Forwarded-Server: xxxxxxx.com\r\n
Connection: Keep-Alive\r\n
如您所见,Upgrade 和 Connection 标头已被删除。有没有办法可以转发所有内容?