vhost

View source
vhost
  • Contributors
    1. Loading...
Author Commit Message Date Builds
benoitc
Following suggestions of @justinsheehy changing dispatching so now we handle host:port matching. so now we match {HostnameParts, Port} tupple in dispatch.conf. I you put HostnameParts only, {HostnameParts, 80} will be matched : {{["example", "com"], 80}, PathSchema, Resource, Options} is equivalent to {["example", "com"], PathSchema, Resource, Options} in the same time, if hostname isn't found {'*', "80"} will be matched. To be homogen with path spec, '*' could only be used on the beginning now. Since the catchall part could be interresting if we are on top of hostname (eg. *.example.com'), the term catchall with thecat…
benoitc
change the way to het Hostname, We try first to see if we are behind a proxy by default we test if X-Forwarded-Host is in the headers (default for apache and some others proxy), proxy host header could also be configured in x_forwared_host application environnement variable. If we aren't behind a proxy we get Host header. If undefined we return no_host_provided and we will match '*' .
benoitc
add better support for cname. Since we want a.b.example.com eventually match to [cname, "example", "com"] where cname = "a.b" .
benoitc
useless debug info more example in dispatch {["example", '*'], [], example_resource, []}. {[cname, "example", '*'], [path], example_resource, []}. {[cname, "example", '*'], [], example_resource, []}. {["test", "example", '*'], [], example_testresource, []}.
benoitc
add vhost support to webmachine. Works as discussed on ml : http://lists.therestfulway.com/pipermail/webmachine_lists.therestfulway.com/2009-September/000077.html so you can do [[cname, "example", ".com"], ["a"], some_resource, []}. [["www", "example", ".com"], ["a"], some_resource, []}. [['*', "example", ".com"], ["a"], some_resource, []}. ... all rules for path dispatching works.