Multiple URLs with Python Flex App Engine?

34 views
Skip to first unread message

Mapperkids Li

unread,
May 17, 2019, 11:08:39 PM5/17/19
to Google App Engine
Hi 

We got one Flex app engine running Python and would like to let multiple clients access the same codebase with their own Cloud SQL instance.

How can I set up the URL mapping, something like client1.app.mydomain.com, client2.app.mydomain.com, client3.app.mydomain.com and all pointing to the same single app engine and then connect to each cloud SQL instance for each client?

Thanks in advance.

Johnny

Harmit Rishi (Cloud Platform Support)

unread,
May 22, 2019, 10:11:41 PM5/22/19
to google-a...@googlegroups.com
Hi, 

Before we dive into your question, I believe it would be worth it for you to understand how applications are structured as well as how the requests are routed on Google App Engine Flex. 

If you wish to have different URL's for each client of yours, you may consider incorporating a dispatch.yaml file with the help of Wildcard mappings which will route the specific URL patterns according to your own rules. In your specific use case, you may consider to do this at the application layer, using the same dispatch.yaml file mentioned above. 

The aim is to route each request through the dispatch file based on the URL supplied as shown in the last example here. This in return will allow you to have distinguishable URL's for the different or a specific service that you set.

ie: customer1.myapp.com and customer2.myapp.com routed to a specific service.

As for the Cloud SQL instance/database connectivity, as all clients are using the same codebase, you would need to manage the connections programmatically. 

Lastly, I would like to mention that this information is intended to provide you some sort of context/direction on how you can go about achieving the set up you have discussed. You may feel free to consult the provided documentation for further in dept considerations of what has been mentioned for your use case. 
Reply all
Reply to author
Forward
0 new messages