1) Two applications per each domain
In my case, each domain serves two applications: the main one, and a second one. I need the main one to be accessible through / url. And I need the second one to be accessible through an url that is different to the application name. To clarify:
Notice that every domain should have the /panel url pointing to the corresponding application (panel1, panel2, etc).
2) Restrict access to specific application according the domain
Whether is parameter-based or pattern-based system, all domains endup having access to all applications, for example,
http://site1.dev/site2/ is showing site2 application. But I would like that the domain
site1.dev can only access the applications site1 and panel1, and nothing else.
What have I achieved so far?
------------ routes.py using parameter-based system -----------------
# -*- coding: utf-8 -*-
routers = dict(BASE = dict(\
domains = {\
'site1.dev':'site1', \
'site2.dev':'site2', \
}))
This approach is working, however I don't know how to make /panel url to serve panel1 application. Also, the problem of the point 2 remains: all domains can access all applications.
------------ routes.py using pattern-based system -----------------
In this case, in addition to the aforementioned problems, I see an error on every url that is not default/index. That is,
http://site1.dev/ shows the default/index, but if I click, let's say, on the register url, the browser attempts to load
site1.dev/site1/default/user/register but I receive an "invalid function" error.
At this point, I'm a bit lost. I'm using nginx, and I asume all this could be done through nginx's rewrite module (however I would like to keep it inside web2py, for portability reasons).
Also, I must say I've never worked with regular expressions, and in addition, as you can see, this scenario is a little bit different than the classic one-app-per-domain.
So, I would really appreciate any advice or help on this.
P/S: if someone feels sufficiently trained to resolve the situation, please contact me by private, I'm willing to spend some money to resolve this situation in a professional manner.