【问题标题】:Apache2 Proxy Pass Include all parameters on URLApache2 Proxy Pass 包括 URL 上的所有参数
【发布时间】:2019-01-03 12:24:30
【问题描述】:

是否可以在 Apache2 上进行代理传递,同时传递传递给后端服务器的参数?

例子:

www.frontserver.com -> www.frontserver.com (meaning that on the base directory it will not be proxied to any backend servers.)

如果它在 /_nuxt 目录下,它将被代理

www.frontserver.com/_nuxt/index.js -> backserver.com/_nuxt/index.js (dynamicaly)

【问题讨论】:

    标签: apache2 proxypass


    【解决方案1】:

    您可以使用P flag of mod_rewrite 执行此任务:

    RewriteEngine On
    RewriteRule "^_nuxt/(.*)" "%{ENV:protocol}://backserver.com/_nuxt/$1" [P]
    

    【讨论】:

      【解决方案2】:

      你可以使用匹配正则表达式的ProxyPassMatch

      ProxyPassMatch "^_nuxt/(.*)" "http://backserver.com/_nuxt/$1"
      

      【讨论】:

      • VirtualHost Element里面有可能吗?
      • ProxyPassMatch 指令可以在 VirtualHost 上下文中使用
      猜你喜欢
      • 2015-01-29
      • 1970-01-01
      • 2017-04-30
      • 2012-02-18
      • 2016-11-02
      • 2014-10-20
      • 1970-01-01
      • 1970-01-01
      • 2015-01-15
      相关资源
      最近更新 更多