Dave Steinberg wrote:
Sebastiaan van Erk wrote:
Hi,

I'm trying to use Pound to direct some URLs (site vs user directories) to different backend servers.

Basically, this is my configuration:

  Service
    HeadRequire "^Host:\s*(www\.)?sebster\.com"
    URL "/~"
    BackEnd
      Address 192.168.1.10
      Port 80
    End
  End
  Service
    HeadRequire "^Host:\s*(www\.)?sebster\.com"
    URL "/[^~]"
    BackEnd
      Address 192.168.1.11
      Port 80
    End
  End

There are two problems I'm having. First of all, if I read the documentation correctly, to stop ~user requests from going to the other server when the first server is down, I've got to match the complement of the /~ URL in the other service. This is quite annoying with regular expressions, and was wondering if there was some other way to go about it. Things I can come up with (but do not find in the docs) are:

1) complements
URL ! "/~" (to match the complement of a regex)

Complements would be a nice addition to pound, I agree. Plus whomever sends in the patch to support has a great pun waiting for them. Who can claim this glorious prize?! :-D

Two options that work with pound right now:

1) Use priorities. This may not achieve the mutually exclusive property, but it may be close enough to basically do what you want.

2) Use an Emergency block. Then designate the .11 host as the emergency host for the first Service block, and vice versa. That will get you the mutually-exclusive part.


Thinking about it again, I think I was confused this morning. Services *are* mutually exclusive, are they not? If there is a service which *matches* but has no available backends, you should get an error message (service not available), and it shouldn't go to the next service. It only keeps trying to find a service as long as it hasn't found a match.

However, complements would still be very useful. :-) And Service nesting would be useful for readability and complex cases.

As for the complement of /~ it's not /[^~]... I forgot the empty string case... /($|[^~]) should be correct I think, but ! /~ would be so much nicer. :)

Regards,
Sebastiaan


--
To unsubscribe send an email with subject unsubscribe to [email protected].
Please contact [email protected] for questions.

Reply via email to