I'm trying to make a SSL proxy using Apache 2 that listens on port 443 and forwards the requests on different IPs/ports based on context:
Scenario:
Make a jBoss "https-remoting" request (it uses HTTP1.1 Upgraded to "jboss-remoting" in Wildfly 8.2), from:
https://xxxxxxx.com:443
and forward it to:
http://192.168.x.y:8080
I've found the following RewriteCond that works:
RewriteCond %{HTTP:Upgrade} jboss-remoting [NC]
RewriteRule ^/(.*)$ http://192.168.x.y:8080/$1 [P]
But i can't figure out what RewriteRule I should apply in order the request to go on http-remoting not http.
Apache Input:
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
Apache Output:
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
As you can see, the Upgrade and Connection headers are stripped out. Is there a way I can forward everything?