简体   繁体   中英

Google App Engine module and custom domain

I'm trying to assign custom domain to App Engine module. At the moment I have staging.example.com pointed to app-id.appspot.com and that works correctly but I also want to assign api.staging.example.com to api.app-id.appspot.com. I've created CNAME record from api.staging.example.com to ghs.googlehosted.com, added api.staging.domain.com in developers console/appengine/settings/custom domains and here is my dispatch.yaml:

dispatch:
  - url: "staging.example.com/*"
    module: default
  - url: "api.staging.example.com/*"
    module: api

Any ideas what could be wrong? Every request to endpoints on api.staging.example.com shows only 404 error and I can't see this in the logs, it looks like api.staging.example.com is pointed to somewhere else, all request to api-app-id.appspot.com works correctly.

Are you making HTTPS requests? The official docs note that double-wildcard domains are not supported for SSL certificates.

Google recommends using the HTTPS protocol to send requests to your app. Google does not issue SSL certificates for double-wildcard domains hosted at appspot.com. Therefore with HTTPS you must use the string "-dot-" instead of "." to separate subdomains

So you'll need to replace the first . with -dot- to follow this pattern: https://module-dot-app-id.appspot.com . In your case api-dot-app-id.appspot.com .

OK, I know where is my problem - Google Cloud Endpoints.

Google Cloud Endpoints does not support custom domains.

https://cloud.google.com/appengine/docs/python/endpoints/

https://code.google.com/p/googleappengine/issues/detail?id=9384

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM