Re: Order of Proxy matching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Evan Champion wrote:
Hi,

Can anyone advise of the order in which <Proxy> statements matching the
same URL are matched?

I am using SetEnvIf to set a variable that is saved later in the
access_log.  Sometimes there is a more specific match and a less
specific match for the same URL, e.g.:

<Proxy http://server1.example.com/*>
	SetEnvIf Server_Addr . VAR=first
      Allow from all
</Proxy>

<Proxy http://*.example.com/*>
	SetEnvIf Server_Addr . VAR=second
      Allow from all
</Proxy>

My observation is that the matches are done in reverse order of
appearance in the configuration, i.e. in this example, a request to
http://server.example.com/ will match the http://*.example.com/* rule
and the variable will be set to "second".  Is it generally correct that
matches are in reverse order of appearance in the configuration?

I don't know the details of how <Proxy> sections work, but there is an alternate possible explanation to what you are seeing : *both* sections above are run, in the order in which they appear, because both of them match. So the first SetEnvIf is executed (VAR=first), but the second one overwrites it (VAR=second).

I believe in this case you may want to use some RewriteCond/RewriteRule (mod_rewrite) to do what you want.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux