Dispatcher configuration examples - matching virtual hosts | Community
Skip to main content
crivabene
October 16, 2015
Solved

Dispatcher configuration examples - matching virtual hosts

  • October 16, 2015
  • 4 replies
  • 977 views

In docs.adobe.com, Dispatcher Configuration, the following example regarding "Virtual Host Resolution" seems to be incorrect.

From: https://docs.adobe.com/docs/en/dispatcher/disp-config.html#Example Virtual Host Resolution

/farms   {   /myProducts     {     /virtualhosts       {       "www.mycompany.com"       }     /renders       {       /hostname "server1.myCompany.com"       /port "80"       }     }   /myCompany     {     /virtualhosts       {       "www.mycompany.com/products/*"       }     /renders       {       /hostname "server2.myCompany.com"       /port "80"       }     }   }

I would expect the following:

/farms { /myProducts { /virtualhosts { "www.mycompany.com/products/*" } /renders { /hostname "server2.myCompany.com" /port "80" } } /myCompany { /virtualhosts { "www.mycompany.com" } /renders { /hostname "server1.myCompany.com" /port "80" } } }

Can you please confirm the rules are inverted?

Thanks,

Claudio

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

document is correct. Because evaluation is bottom up.

4 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

document is correct. Because evaluation is bottom up.

crivabene
crivabeneAuthor
October 16, 2015

Hi Sham,

Got it. In this case I would expect the example to be:

/farms { /myCompany { /virtualhosts { "www.mycompany.com" } /renders { /hostname "server1.myCompany.com" /port "80" } } /myProducts { /virtualhosts { "www.mycompany.com/products/*" } /renders { /hostname "server2.myCompany.com" /port "80" } } }

No functional difference, only the correct farm names to improve the overall clarity of the example itself. Correct?

Sham_HC
Level 10
October 16, 2015

CLAUDIO RIVABENE wrote...

 

No functional difference, only the correct farm names to improve the overall clarity of the example itself. Correct?

 

agree & make sense.

March 10, 2017

The example in the documentation shows the following table:

Using this example, the following table shows the virtual hosts that are resolved for the given HTTP requests:

 

However, that does not seem to match up with what the documentation says (for the second request):

Dispatcher finds the best-matching virtual host value in the following manner:

  • The first-encountered virtual host that matches all three of the host, the scheme, and the uri of the request is used.
  • If no virtualhosts values has scheme and uri parts that both match the scheme and uri of the request, the first-encountered virtual host that matches the host of the request is used.
  • If no virtualhosts values have a host part that matches the host of the request, the topmost virtual host of the topmost farm is used.

For the second request, it seems the 2nd rule above would kick in, meaning that the www.mycompany.com/products/* would be the resolved virtual host (scheme and uri don't match any virtualhosts - unless www.mycompany.com is interpreted as www.mycompany.com/*). Since the evaluation is bottom up, the host would match on the last virtualhost. What am I missing?