On Sep 4, 2013, at 8:41 AM, Leif Hedstrom <[email protected]> wrote: > On Sep 4, 2013, at 7:05 AM, Igor Galić <[email protected]> wrote: > >> >> Hi folks, >> >> I'm writing on a puppet module to build a remap config (among other things). >> right now I'm creating reverse_map rules automatically if reverse_map is >> empty, simply by reversing map rules. >> >> It turns out to be highly naïve: >> >> map http://example.org http://web-backend-42 >> map http://examples.com http://web-backend-42 >> >> How do I reverse_map that? > > Unfortunately, you don't. If there is no 1-to-1 mapping on the reverse, how > would it know which one to choose ?
Thinking about it, IF we tagged the request to origin with the remap rule that triggered, it would theoretically be possible to have remap rules such that the forward and reverse rules are united. A possible problem with this feature addition is what happens on cache hits. IF the header is modified prior to storing it in cache, it'll work fine (and I hope that is the case :). You should file an RFE with this. Note that this would require changes to remap.config, so perhaps this is something to consider for the new configuration format? -- Leif
