问题
I have Node JS app running on google app engine.
I have linked a custom domain to it: www.singlelisting.co
BUT
I need wildcard subdomains to also link to the node application
For Example: 6.singlelisting.co or ns324.singlelisting.co
I have not had much luck reading the documentation on google developers site I am using cloudflare for DNS management and have added * records for all the google A and AAAA records. I believe the problem is have google is seeing the subdomains. Any help would be greatly appreciated
回答1:
You have two options:
- Mapping subdomains: in your App Engine Custom domains config you need to add the following entry
*.singlelisting.co
and then update the DSN management with the required records (as you probably did). This means that requests through6.singlelisting.co
orns324.singlelisting.co
will be handled by the6
, respectivelyns324
service of you App Engine deployment, if available. As the documentation states:If you set up a wildcard subdomain mapping for your custom domain, then your application serves requests for any subdomain that matches: .If the user browses a domain that matches a service name, the application serves that service.
- By using a dispatch file (more info here): this file will override the routing rules established (or not) through your domains config.
So basically if you do not have services named 6
and ns324
that will automatically handle requests incoming through the wildcard rule *.singlelisting.co
, you have to describe the routing using the dispatch.yaml
.
来源:https://stackoverflow.com/questions/49344836/google-app-engine-wildcard-subdomains