首页 > 解决方案 > Apache2 Proxy Pass 包括 URL 上的所有参数

问题描述

是否可以在 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)

标签: apache2proxypass

解决方案


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

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

推荐阅读