Home > Blockchain >  Deploying a service to a subdomain Google App Engine
Deploying a service to a subdomain Google App Engine

Time:10-17

I have two services in my Google App Engine project: default and betaversion they are currently, successfully deployed to different domains (e.g., example and otherwebsite), because I can't get the one deployed on the subdomain. what I'd like is for default to be at:

example.com

and for the beta to be at:

beta.example.com

so I only have to maintain 1 domain. I've made and deployed a dispatch.yaml file and added the beta CNAME DNS registration in the app engine settings and with my DNS registrar.

dispatch:
  - url: "example.com/*"
    service: default

  - url: "otherwebsite.com/*"
    service: betaversion
    
  - url: "beta.example.com/*"
    service: betaversion

beta.example.com works, but it's routing to the default service. I feel like I must be missing something small, but it's driving me crazy. Any help or ideas would be appreciated.

CodePudding user response:

It could be that you have not specified the service name in the yaml for the non-default service. If you don't specify a service name, I think it will go to the default service.

In addition, we have a blog post (complete with an example) about this scenario. Maybe something there will help you.

CodePudding user response:

In case this helps anyone, the issue was that my updated dispatch.yaml file was inside of an undeployed version of the app.yaml file in the betaversion service.

If editing the dispatch.yaml file - make sure you also re-deploy the location containing that dispatch file. In my case, deploying it using

gcloud app deploy service-folder/dispatch.yaml 

did not work unless I also deployed the service as well

gcloud app deploy service-folder/app.yampl service-folder/dispatch.yaml
  • Related