代理端口没有在apache中更改URL

时间:2013-10-22 15:04:07

标签: apache proxy apache2 mod-proxy

有没有办法将URL代理到apache中的另一个端口? 例如,我想(反向)代理URL:

http://*.localhost/engine.io/?EIO=2&transport=polling

从端口80到端口8080而不更改url:

http://*.localhost:8080/engine.io/?EIO=2&transport=polling

谢谢!

1 个答案:

答案 0 :(得分:1)

*.localhost(端口80)虚拟主机中,添加:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(.*)$
RewriteRule ^/engine\.io/$ http://%1:8080/engine.io/?%{QUERY_STRING} [L,P]