Apache代理和重写代理的规则

我将Apache服务器设置为侦听端口8080的本地服务器的代理。无论指定有效的代理服务器,它都可以工作。 两种configuration都可以工

configuration1:

<Proxy http://localhost:8080> Order deny,allow Allow from all </Proxy> RewriteEngine on RewriteRule ^(.*) http://localhost:8080$1 [P] 

configuration2:

 RewriteEngine on RewriteRule ^(.*) http://localhost:8080$1 [P] 

任何人都可以向我解释为什么我不需要指定一个有效的代理,如configuration2中所示?

Proxy http://localhost:8080仅用于应用权限和其他apache规则(限制某些客户端IP,请求身份validation等),而不是configuration代理服务器本身。

没有mod_rewrite的等效代理将如下所示:

 ProxyPass / http://localhost:8080 

或者,如果您需要应用任何forms的限制:

 <Proxy http://localhost:8080> Order allow,deny Allow from all Deny from badguy </Proxy> ProxyPass / http://localhost:8080