The HTTP protocol works like so: 1) Connect to endpoint, using SSL if necessary. (Note we haven't sent any text or commands yet...) 2) Send request GET /mysite/somepage.html HTTP/1.0 Host: www.domain.com
Connecting to the server is done by the browser... It extracts the host and port for connection purposes. Also note that the Host header is optional.... Browsers put it in but requests could come through without a host header. ( which is why apache has directives that work with namevirtualhosts to handle the "default" case) Bottom line is, pound's URL matches the string after the GET, which does not have the host or protocol. The only time you'd have a full protocol, host and port in the URL is if you were talking to a proxy server. The proxy server would forward your request to the URL specified, but it would do so like a browser - it would turn it into a request like the above when it connected to the destination. Joe Gooch K12 Systems Inc On Oct 20, 2009, at 11:55 PM, "Eric B." <[email protected]> wrote: > Hi Jacques, > > I'm not sure I understand what you mean by "The host is not present > in the > URL in HTTP". Can you please elaborate? > > If a client tries to connect to > http(s)://www.domain.com/mysite/somepage.html, would the the URL not > match > to ^http(s)?://www\.domain\.com/.* ? > Would that not be equivalent of matching to header ^Host:\s*www > \.domain\.com > ? > > Am I misunderstadning something obvious? > > Thanks, > > Eric > > > "Jacques Caron" <[email protected]> wrote in > message news:[email protected]... >> Hi, >> >> The host is not present in the URL in HTTP (in this context at >> least -- >> it's a different matter with an "explicit" proxy). So you have to use >> HeadRequire. However there can be (and there usually are) spaces >> between >> the Host: and the domain, and you don't want to match other headers >> than >> might end up with "Host". >> >> The "right" syntax is thus probably rather: >> HeadRequire "^Host:\s*www.example.tld" >> >> Jacques. >> >> At 21:54 20/10/2009, Eric B. wrote: >>> Hi, >>> >>> I was reading through the man pages and was trying to figure out >>> the best >>> way to define a virtual host in Pound. The was I see it, I have 2 >>> options: >>> 1) Specify a URL pattern in my Service >>> 2) Specify a HeadRequire Host: pattern in my Service >>> >>> Ex: >>> Service >>> URL ".*//demo.domain.com.*" >>> End >>> >>> or >>> >>> Service >>> HeadRequire "Host:demo.domain.com.*" >>> End >>> >>> Is there an advantage of using one vs the other? Or should I use >>> both? >>> What advantage, if any, does the URL give over the HeadRequire >>> instruction? >>> >>> Thanks, >>> >>> Eric >>> >>> >>> >>> >>> -- >>> To unsubscribe send an email with subject unsubscribe to >>> [email protected]. >>> Please contact [email protected] for questions. >> >> >> -- >> To unsubscribe send an email with subject unsubscribe to >> [email protected]. >> Please contact [email protected] for questions. >> > > > > > -- > To unsubscribe send an email with subject unsubscribe to [email protected] > . > Please contact [email protected] for questions. -- To unsubscribe send an email with subject unsubscribe to [email protected]. Please contact [email protected] for questions.
