On Feb 4, 2011, at 1:54 AM, Martin Weissenboeck wrote: > Thanks for all answers. > A second question: > > If I want to use port 8000 for http and 8001 for https: > is it possible to write > > routers = dict( > BASE = dict( > domains = { > 'http://www.domain.com:8000' : 'myappname1', > 'https://www.domain.com:8001' : 'myappname2', > } > ), > ) > > Or: how does web2py know which protocol should be used? >
The domains dict does not support the scheme string. Your example above needs to be: routers = dict( BASE = dict( domains = { 'www.domain.com:8000' : 'myappname1', 'www.domain.com:8001' : 'myappname2', } ), ) web2py doesn't need to know what the protocol is (and for that matter has no guaranteed way of finding out, though often it's available from the server). But if both http and https are supported, they can't both be on the same domain:port combination. So (as above) use the port to distinguish.