Stay organized with collections Save and categorize content based on your preferences.
Region IDThe REGION_ID
is an abbreviated code that Google assigns based on the region you select when you create your app. The code does not correspond to a country or province, even though some region IDs may appear similar to commonly used country and province codes. For apps created after February 2020, REGION_ID.r
is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL.
Learn more about region IDs.
This page describes how HTTP requests from users reach the appropriate version of a service. Requests can be routed in the following ways:
These options apply only to deployed apps. When you are testing locally, the routing behavior depends on the particular runtime and development environment that you're using.
Routing with URLsOnce your app is running in App Engine, you can use the following URL to send HTTP requests to the app:
https://PROJECT_ID.REGION_ID.r.appspot.com
where PROJECT_ID
is the ID of the Google Cloud project that contains the app.
This URL sends requests to your app's default service at the version that you have configured to receive traffic.
Note: We recommend using the HTTPS protocol to send requests to your app. HTTPS requests sent to theREGION_ID.r.appspot.com
must use the string "-dot-
" to separate subdomains instead of ".
". You can use the simple ".
" URL notation with your own custom domains and with HTTP requests. URLs for services and versions
If you create more than one service in your app, each service has its own URL. Each version of a service also has its own URL, so you can deploy and test a new version before configuring that version to receive traffic.
The URLs for specific services and versions are in the following form:
VERSION-dot-SERVICE-dot-PROJECT_ID.REGION_ID.r.appspot.com
You can omit VERSION-dot-
if you don't need to target a specific version.
To retrieve the IDs of your app's services and versions, you can use any of the following tools:
Example URLsHere are some examples of URLs for App Engine, showing both the appspot.com
domain that App Engine assigns to your app and a custom domain, which you can set up for your app.
default
service:
https://PROJECT_ID.REGION_ID.r.appspot.com
https://CUSTOM_DOMAIN
Requests are received by any version that is configured for traffic in the default
service.
https://SERVICE_ID-dot-PROJECT_ID.REGION_ID.r.appspot.com
https://SERVICE_ID.CUSTOM_DOMAIN
Requests are received by any version that is configured for traffic in the targeted service. If the service that you are targeting does not exist, the request gets soft routed.
default
service:
https://VERSION_ID-dot-default-dot-PROJECT_ID.REGION_ID.r.appspot.com
https://VERSION_ID.CUSTOM_DOMAIN
When a service is not targeted, requests are sent to the default
service.
If a request matches the PROJECT_ID.REGION_ID.r.appspot.com
portion of the hostname, but includes a service, version, or instance name that does not exist, then the request is routed to the default
service. Soft routing does not apply to custom domains; requests to them will return a HTTP 404
status code if the hostname is invalid.
The following URL patterns reach their target, if they exist. Requests that don't pass through Cloud Load Balancing are never intercepted and rerouted by the patterns that you have defined in your dispatch file:
https://VERSION-dot-SERVICE-dot-PROJECT_ID.REGION_ID.r.appspot.com
https://VERSION_ID.SERVICE_ID.PROJECT_ID.CUSTOM_DOMAIN
You can create a dispatch file to override App Engine's URL-based routing rules and define your own custom routing rules. With a dispatch file, you can send incoming requests to a specific service based on the path or hostname in the request URL.
Creating a dispatch fileTo create a dispatch file:
Create a file named dispatch.yaml
either in the root of your project directory, or in the root directory of your default
service.
Define routing rules in the file as described see the dispatch.yaml
reference.
Note the following about the routing rules:
url
and service
elements..
" notation for separating subdomains. URLs defined with the HTTPS "-dot-
" notation are not supported.cron.yaml
file.For example, you can create a dispatch file to route mobile requests like https://simple-sample.uc.r.appspot.com/mobile/
to a mobile frontend, and route worker requests like https://simple-sample.uc.r.appspot.com/work/
to a static backend:
dispatch:
# Send all mobile traffic to the mobile frontend.
- url: "*/mobile/*"
service: mobile-frontend
# Send all work to the one static backend.
- url: "*/work/*"
service: static-backend
Deploying the dispatch file
To deploy the dispatch file using gcloud
, run the following command:
gcloud app deploy dispatch.yaml
Routing with Cloud Load Balancing
Cloud Load Balancing is a separate product that enables advanced network configurations for all of your applications running on Google Cloud.
When HTTP(S) Load Balancing is enabled for serverless apps, you can:
Configure your serverless app to serve from a dedicated IPv4 or IPv6 IP address that is not shared with other services.
Reuse the same SSL certificates and private keys that you use for Compute Engine, Google Kubernetes Engine, and Cloud Storage. This eliminates the need to manage separate certificates for serverless apps.
If the Serverless NEG specifies a service, version, or a tag, the load balancer doesn't interfere or interact with routing rules in your dispatch.yaml
file. The dispatch.yaml
rules are not evaluated until a serverless NEG directs traffic to App Engine. Targeted routing fails when the Serverless NEG doesn't specify service, version, or a tag, and routing relies on the rules you specify in the dispatch.yaml
file.
Note the following:
The App Engine flexible environment dashboard displays all metrics only for requests routed through a flexible environment managed backend. If you use App Engine flexible environment with Cloud Load Balancing, then certain metrics in the App Engine metrics table are reported as metrics from the loadbalancing
table instead. For more information, see HTTP(S) Load Balancing logging and monitoring.
The REGION_ID
is an abbreviated code that Google assigns based on the region you select when you create your app. The code does not correspond to a country or province, even though some region IDs may appear similar to commonly used country and province codes. For apps created after February 2020, REGION_ID.r
is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL.
You can use the following tools to see the region ID of your app:
ConsoleIn the Google Cloud console, you can view the URLs for your app's Instances, Services, and Versions.
All of these URLs include the region ID.
gcloudWhen you deploy an app or service, the gcloud app deploy
command displays the URL after the deployment succeeds. This URL includes the region ID.
To view the URL for a service that is already deployed:
Enter the gcloud app versions list
command to list the versions of a specific service. For example, to list the versions of the default service, enter gcloud app versions list --service=default
.
Enter the gcloud app versions describe
command. The output of that command includes the version URL with the app's region ID. For example, to describe version 20191023t101741 for the default service, enter gcloud app versions describe 20191023t101741 --service=default
The domain name used for the request is included in the request data that is passed to your app. Therefore, you can use the request data to control how your app responds based on the domain name in the request. For example, if you want to redirect to an official domain, you can code your app to check the Host
request header and then respond accordingly based on the domain name.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `REGION_ID` is a Google-assigned code based on the region selected during app creation, which is included in App Engine URLs for apps created after February 2020, and it does not directly correspond to a country or province."],["HTTP requests to App Engine apps can be routed using URLs, a dispatch file, or Cloud Load Balancing, with URL routing allowing direct access to specific services and versions, such as the default service."],["Dispatch files allow custom routing rules to be defined, directing requests to specific services based on the request URL's path or hostname, and it will use the HTTP url patterns with the \".\" notation."],["Cloud Load Balancing enables advanced network configurations for Google Cloud apps, including dedicated IP addresses and reused SSL certificates, but it operates independently of the routing rules defined in `dispatch.yaml`."],["Soft routing will reroute a request to the default service if it includes an invalid service, version, or instance name, but it does not apply to custom domains, which will return a 404 error instead."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4