【问题标题】:Replacing ProxyPass with RewriteRule用 RewriteRule 替换 ProxyPass
【发布时间】:2019-01-25 07:55:24
【问题描述】:

我在 Apache 中遇到了一个已知错误,如果您在 ProxyPass 指令中使用很长的主机名,则会导致错误。建议的解决方法是用 RewriteRule 替换 ProxyPass。我很难让 RewriteRule 工作。这就是我的 ProxyPass 的样子:

ProxyPass /_plugin/kibana https://long-aws-hostname/_plugin/kibana   timeout=300
ProxyPassReverse /_plugin/kibana https://long-aws-hostname/_plugin/kibana   timeout=300

你会如何使用 RewriteRule 重写它?

谢谢, 史蒂夫

【问题讨论】:

    标签: apache mod-rewrite mod-proxy


    【解决方案1】:
    <Proxy balancer://ServiceCoreCluster>
        BalancerMember http://localhost:7080
        # Add more BalanceMember if Service is present in different host
        # BalancerMember http://<hostname>:<port>
    </Proxy>
    .
    .
    .
    
    RewriteEngine on
    
    RewriteRule "^/_plugin/kibana$" "balancer://ArgusCoreCluster/https://long-aws-hostname/_plugin/kibana" [P,L]
    

    添加以上行,如果您已经配置了平衡器,只需添加最后 2 行(替换为您的行)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-27
      • 1970-01-01
      • 2020-06-29
      • 2015-06-13
      • 2017-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多