简体   繁体   English

Apache 2.2 ProxyPassMatch正则表达式

[英]Apache 2.2 ProxyPassMatch RegEx

I would like to use Apache 2.2 ProxyPassMatch to make a Reverse Proxy. 我想使用Apache 2.2 ProxyPassMatch制作反向代理。

Expectations: Exclude specified directories in the DocumentRoot and all others redirect to. 期望:排除DocumentRoot中的指定目录,并将所有其他目录重定向到。

Example: 例:

  1. DocRoot DocRoot
    • Project1 项目1
      • Dir1 目录1
      • Dir2 目录2
    • Project2 项目2
      • Dir3 目录3
      • Dir4 目录4
      • Dir5 目录5
    • Project3 项目3
      • Dir6 目录6

Redirect the "Project1" and "Project2" directories (and all files and subdirectories), but not redirect the "Project3" directory (and all files and subdirectories). 重定向“ Project1”和“ Project2”目录(以及所有文件和子目录),但不重定向“ Project3”目录(以及所有文件和子目录)。

Try the following set of rules: 尝试以下规则:

ProxyPass /project3 !
ProxyPass / http://reverse.proxy-address.com/

Make sure that mod_proxy is enabled. 确保启用了mod_proxy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM