我如何redirecthttpstream量?

我的客户端发送请求到http:// localhost:80 / test / string 。 但是我的处理单元位于http:// localhost:9080 / servlet / Endpoint?req = test 。

我想要这个redirect透明的客户端。 我的客户端应该接受来自http:// localhost:9080 / servlet / Endpoint的响应req = test仍然认为响应来自http:// localhost:80 / test / string 。

怎么办? 是否有可能使用代理服务器做到这一点?

另一个解决scheme是你用apache和proxy_http模块(默认包含)设置一个反向代理:

configuration文件应该是这样的:

ProxyRequests off ProxyPass / http://localhost:9080/ ProxyPassReverse / http://localhost:9080/ 

然后玩mod_rewrite。

  • 反向代理与Apache
  • mod_rewrite的