Connecting AppEngine Module to a custom DNS - google-app-engine

I've been having troubles trying to connect a module to my custom domain.
I works perfectly on the appspot domain but not on my custom domain.
E.G.
http://m.myappname.appspot.com calls the dispatch.yaml file which routes the request to my mobile frontend
BUT
http://m.myappcustomdomain.com serves the default module (app.yaml)
Any help will be highly appreciated.
Thanks

You could an entry like this in your dispatch.yaml file:
- url: "m.myappcustomdomain.com/*"
module: your_mobile_module

Related

istio path based routing for react based SPAs

We are trying to implement path-based routing using Istio virtual service. Our application is react based SPA and it expects “/” instead of the path. We want to have a single host and we pass the app name as a parameter along with the URL and expect to reach the applications like
https://digital.example.com/app1 and https://digital.example.com/app2
we tried to define “/app1 or /app2” in virtual service as a routing rule instead of “/”, but SPA is not getting loaded and we are getting 404.
and tried the below configuration.
http:
- match:
- uri:
prefix: /
route:
- destination:
host: app1
port:
number: 80
Reference used: Istio Ingress routing fails with 404 for Nginx/Angular app
This is working for app1 and tried the same rule for app2.and it is not working, getting a blank page. / should be routed to Frontend to get the Index.html.how do we handle this issue? Any help is much appreciated.

Deploying a service to a subdomain Google App Engine

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.
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
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.

App engine endpoints API - 404 with custom domain

I'm trying to use custom domain with app engine. Everything works fine with localhost and appspot url. But with custom domain endpoints api doesn't work; the API discovery request (https://cc.mdsarowar.me/_ah/api/discovery/v1/apis/conference/v1/rest) returns Not Found with error code 404.
Here is my app.yaml (full code):
- url: /_ah/spi/.*
script: conference.api
secure: optional
And endpoints api (full code):
#endpoints.api( name='conference',
version='v1',
allowed_client_ids=[WEB_CLIENT_ID, API_EXPLORER_CLIENT_ID],
scopes=[EMAIL_SCOPE], hostname = 'cc.mdsarowar.me')
class ConferenceApi(remote.Service):
"""Conference API v0.1"""
........
Thanks in advance.
As per the docs:
Note: Google Cloud Endpoints does not support custom domains.
Edit
There is an open feature request for this so you may want to star it.

Is there any way to route sub-domain to module in Google Appengine

I configured my dispatch.yaml file to route /admin to Admin module. But I want to route my sub-domain to route the Admin module.
My dispatch.yaml file contains the following code
- url: "*/admin"
module: admin
- url: "*/admin/*"
module: admin
In admin module
app = webapp2.WSGIApplication([
routes.DomainRoute('admin.knowyouroffers.in', [
webapp2.Route('/', handler=Admin, name='home'),
]),debug=settings.debug)
I tried the following code in dispatch.yaml. But It couldn't work
- url: "admin.knowyouroffers.in/*"
module: admin
You don't need to specify the domain in the admin module, that code gets invoked only after the request has been already routed to the module following the dispatch.yaml rules. Plain path routing in the module is enough and it also allows you to test your code before deploying in production (which otherwise is the only place where the domain would be filled in properly to match the routing rules).
Check your request logs in all modules to debug routing. See also this Q&A:
Appengine: Routing with dispatch.yaml

AppEngine modules on custom domain

I plan to make a main website and a blog.
www.domain-name.com will be my main website and blog.domain-name.com
will be my blog.
I am able to achieve this on my appspot domain, but on my custom domain, it doesn't work.
https://blog-dot-domainname.appspot.com/ is showing the correct
webpage.
Currently blog.domain-name.com shows the exact same thing as www.domain-name.com.
Here's what I did:
dispatch.yaml file
dispatch:
# Default module serves the typical web resources and all static resources.
- url: "*/favicon.ico"
module: default
- url: "domain-name.com"
module: default
- url: "blog.domain-name.com/*"
module: blog
I also setup two custom domain names on the AppEngine settings:
CUSTOM DOMAIN NAMES domain-name.com blog.domain-name.com
I am using Namecheap and I setup the required CNAME alias for my bog subdomain.

Resources