Reputation: 587
My use case is this: I have a domain that points to a server at IP 1.2.3.4 and I would like a subdomain at the domain to point to my App Engine application i.e.
example.com --> 1.2.3.4
app.example.com --> App Engine application
The naked domain as well as the www subdomain must point to the standalone server.
From what I've found out so far, this doesn't seem possible.
Would anyone be able to confirm if this configuration is indeed not possible?
Upvotes: 6
Views: 2160
Reputation: 519
App Engine doesn't need to have the A records on the root domain if you are only serving from a subdomain. App Engine should work properly for you with just the one CNAME on subdomain.example.com.
Duplicate of App Engine and Firebase Hosting in One Domain
This is the correct answer and is working as expected.
Upvotes: 0
Reputation: 21
This is definitely possible, I've done it for the exact same scenario:
Eventually, gcp should see it's provided records on the DNS records and should issue certificates for https.
On gcp, adjust the dispatch.yaml file to route things to the service I wanted:
dispatch:
- url: "mysubdomain.example.com/*"
service: myservice
Your service should now be accessible via https://mysubdomain.example.com with a pretty padlock to go with it.
Upvotes: 2
Reputation: 525
I might actually have a better solution to this. You can only verify the subdomain.domain.tld with google. Then you only will add A and AAAA entries to the DNS, with the alias subdomain.
subdomaid.domain.tld will then be independent from domain.tld
Upvotes: 5
Reputation: 5835
There might be another option, but I can't really test it for sure as I can't risk it my app ever fails without me knowing.
So from my empirical testing, I was able to set the domain to external hosting and subdomain to GAE:
Upvotes: 1
Reputation: 1321
I found out it is possible to verify ownership of the whole url, and use that...
Upvotes: 0
Reputation: 587
After much testing, I've come to the conclusion that the scenario which I've painted is not feasible. So I settled for www.example.com
to point to the web server (1.2.3.4) and app.example.com
When users go to the naked domain example.com
, they get redirected to www.example.com
Here's what I did:
www
subdomain, andwww
to point to the web server IP (i.e. 1.2.3.4)app
to point to ghs.googlehosted.com
so that app.example.com
points to the App Engine application.Upvotes: 1
Reputation: 482
Yes, I can confirm this is possible. In fact, it is the recommended way for handling the microservice architecture on App Engine [0].
In your case specifically, all you have to do is create a CNAME
with your DNS registrar pointing to ghs.googlehosted.com
.
You then have to first verify your TLD with App Engine and add a specific mapping to your subdomain as described here [1].
Let me know if you have any specific questions with the process.
[0] https://cloud.google.com/appengine/docs/standard/python/microservices-on-app-engine
[1] https://cloud.google.com/appengine/docs/standard/python/console/using-custom-domains-and-ssl
Upvotes: 1