【问题标题】:Proxy port without changing URL in apache代理端口而不更改 apache 中的 URL
【发布时间】:2013-10-31 12:59:49
【问题描述】:

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

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

从80端口到8080端口,不改变url:

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

谢谢!

【问题讨论】:

    标签: apache proxy apache2 mod-proxy


    【解决方案1】:

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

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

    【讨论】:

    猜你喜欢
    • 2019-07-12
    • 2011-07-13
    • 2015-04-02
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 1970-01-01
    • 2017-09-07
    • 2012-08-12
    相关资源
    最近更新 更多