I have two very simple services set up (in python) on google app engine. I have a site which has been up for a while as the defualt
service of my example
project, and I just deployed another service, lets call it foo
. I have dns forwarding working for the default service, so I can go to example.com
(which I own in this hypothetical scenario) and see my default service. I can also go to foo.example.appspot.com
and see my foo
service, which works at the url.
I have also registered another domain, let's call it foo.com
. What I want is for foo.com
to use my foo.example.appspot.com
service. To make matters trickier, foo.com
has a bunch of sub-domains of it's own, so I need x.foo.com
to go to my foo
service as well (and even x.y.foo.com
would be ideal, but if that is hard I can work around that one easily enough by just substituting out another character so it would be x-y.foo.com
or something along those lines).
I'm pretty new to web dev (which is honestly a generous description for this simple project), but Iv'e spent a while reading and googling and haven't found a solution to this, so any advice would be helpful. My last resort would be to un-service-ify (if you will) the two services, and just bundle it all up into one big main.py
which routes differently depending on the domain, and then point both domains at the default
service. The big downside to this is that I already have everything working with services (which seems like a better approach).
I expect to get very few users so scaling isn't really an issue (though it's always interesting to learn about).
EDIT:
attempted to create a dispatch.yaml
file to solve this as follows:
dispatch:
- url: "foo.com"
module: foo
- url: "*.foo.com"
module: foo
but when I run appcfg.py -A <project_id_here> update_dispatch .
it says
Error parsing yaml file:
Unable to assign value 'foo.com' to attribute 'url':
invalid url 'foo.com'
in "./dispatch.yaml", line 3, column 10