REGION_ID는 앱을 만들 때 선택한 리전을 기준으로 Google에서 할당하는 축약된 코드입니다. 일부 리전 ID는 일반적으로 사용되는 국가 및 주/도 코드와 비슷하게 표시될 수 있지만 코드는 국가 또는 주/도와 일치하지 않습니다. 2020년 2월 이후에 생성된 앱의 경우 REGION_ID.r이 App Engine URL에 포함됩니다. 이 날짜 이전에 만든 기존 앱의 경우 URL에서 리전 ID는 선택사항입니다.
App Engine을 사용하여 정적 웹사이트를 호스팅할 수 있습니다. 정적 웹페이지에는 HTML, CSS, 자바스크립트와 같은 클라이언트 측 기술이 포함될 수 있습니다. App Engine 표준 환경에서는 무료 등급을 제공하기 때문에 App Engine에서 정적 사이트를 호스팅하는 것이 기존 호스팅 업체를 사용하는 것보다 비용이 적게 듭니다.
App Engine에서 호스팅되는 사이트는 [my-project-id].uc.r.appspot.com과 같은 REGION_ID.r.appspot.com 하위 도메인에서 호스팅됩니다. 사이트를 배포한 후에는 App Engine에서 호스팅하는 웹사이트에 자신의 도메인 이름을 매핑할 수 있습니다.
시작하기 전에
App Engine에서 웹사이트를 호스팅하려면 먼저 다음을 수행하세요.
새 Google Cloud 콘솔 프로젝트를 만들거나 사용할 기존 프로젝트의 프로젝트 ID를 검색합니다.
www/: HTML, CSS, 이미지, 자바스크립트와 같은 모든 정적 파일을 저장할 디렉터리입니다.
css/: 스타일시트를 저장할 디렉터리입니다.
style.css: 사이트의 형식과 분위기를 지정하는 기본 스타일시트입니다.
images/: 이미지를 저장할 선택적 디렉터리입니다.
index.html: 웹사이트의 콘텐츠를 표시하는 HTML 파일입니다.
js/: 자바스크립트 파일을 저장할 선택적 디렉터리입니다.
기타 애셋 디렉터리
app.yaml 파일 만들기
app.yaml 파일은 URL을 정적 파일에 매핑하는 방법을 App Engine에 안내하는 구성 파일입니다. 다음 단계에서는 다른 사용자가 내 웹사이트를 방문할 때 www/index.html을 로드하는 핸들러를 추가합니다. 모든 정적 파일은 www 디렉터리에 저장되고 여기에서 호출됩니다.
애플리케이션의 루트 디렉터리에 app.yaml 파일을 만듭니다.
프로젝트 ID와 이름이 같은 디렉터리를 만듭니다. Console에서 프로젝트 ID를 찾을 수 있습니다.
방금 만든 디렉터리에서 app.yaml이라는 파일을 만듭니다.
app.yaml 파일을 수정하고 웹사이트 요구사항에 따라 핸들러 요소를 추가합니다. 예를 들어 다음과 같이 Python 런타임용 app.yaml 파일을 만들 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eApp Engine can host static websites, including HTML, CSS, and JavaScript, potentially offering cost savings compared to traditional hosting due to its free tier.\u003c/p\u003e\n"],["\u003cp\u003eEach App Engine application is assigned a \u003ccode\u003eREGION_ID\u003c/code\u003e upon creation, which is included in the application's URL, formatted as \u003ccode\u003eREGION_ID.r.appspot.com\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo host a website, you need to create an \u003ccode\u003eapp.yaml\u003c/code\u003e configuration file to map URLs to your static files, and have a project directory to store the static files, including an \u003ccode\u003eindex.html\u003c/code\u003e file for the home page.\u003c/p\u003e\n"],["\u003cp\u003eDeploying the website involves using the \u003ccode\u003egcloud app deploy\u003c/code\u003e command from the application's root directory to upload the website content to App Engine.\u003c/p\u003e\n"],["\u003cp\u003eThe Region ID can be used to view your website in your browser by using the command \u003ccode\u003egcloud app browse\u003c/code\u003e, at \u003ccode\u003ehttps://PROJECT_ID.REGION_ID.r.appspot.com\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Hosting a static website on App Engine\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/standard/python/how-requests-are-routed#region-id). \nOK\n\nYou can use App Engine to host a static website. Static web pages\ncan contain client-side technologies such as HTML, CSS, and JavaScript. Hosting\nyour static site on App Engine can cost less than using a traditional\nhosting provider, as App Engine standard environment provides a free tier.\n\nSites hosted on App Engine are hosted on the\n\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`\nsubdomain, such as `[my-project-id].uc.r.appspot.com`. After you deploy your\nsite, you can map your own domain name to your App Engine hosted website.\n\nBefore you begin\n----------------\n\nBefore you can host your website on App Engine:\n\n1. Create a new Google Cloud console project or retrieve the project ID of\n an existing project to use:\n\n [Go to the Projects page](https://console.cloud.google.com/project)\n | **Tip:** You can retrieve a list of your existing project IDs with the [gcloud command line tool](#before_you_begin).\n2. Install and then initialize the Google Cloud CLI:\n\n [Download the SDK](/sdk/docs/install)\n\n### Listing your Google Cloud console project IDs\n\nFrom the command line, run: \n\n gcloud projects list\n\nOK\n\nCreating a website to host on Google App Engine\n-----------------------------------------------\n\n### Basic structure for the project\n\nThis guide uses the following structure for the project:\n\n- `app.yaml`: Configure the settings of your App Engine application.\n- `www/`: Directory to store all of your static files, such as HTML, CSS, images, and JavaScript.\n - `css/`: Directory to store stylesheets.\n - `style.css`: Basic stylesheet that formats the look and feel of your site.\n - `images/`: Optional directory to store images.\n - `index.html`: An HTML file that displays content for your website.\n - `js/`: Optional directory to store JavaScript files.\n - Other asset directories.\n\n### Creating the `app.yaml` file\n\nThe `app.yaml` file is a configuration file that tells App Engine how to\nmap URLs to your static files. In the following steps, you will add handlers\nthat will load `www/index.html` when someone visits your website, and all static\nfiles will be stored in and called from the `www` directory.\n\nCreate the `app.yaml` file in your application's root directory:\n\n1. Create a directory that has the same name as your project ID. You can find your project ID in the [Console](https://console.cloud.google.com/).\n2. In directory that you just created, create a file named `app.yaml`.\n3. Edit the `app.yaml` file and add the handlers element based on your website\n requirements. For example, `app.yaml` file for Python\n runtime may be created as follows:\n\n runtime: python39\n\n handlers:\n - url: /\n static_files: www/index.html\n upload: www/index.html\n\n - url: /(.*)\n static_files: www/\\1\n upload: www/(.*)\n\nMore reference information about the `app.yaml` file can be found in the\n[`app.yaml` reference documentation](/appengine/docs/standard/reference/app-yaml).\n\n### Creating the `index.html` file\n\nCreate an HTML file that will be served when someone navigates to the root page\nof your website. Store this file in your `www` directory. \n\n \u003chtml\u003e\n \u003chead\u003e\n \u003ctitle\u003eHello, world!\u003c/title\u003e\n \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"/css/style.css\"\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eHello, world!\u003c/h1\u003e\n \u003cp\u003e\n This is a simple static HTML file that will be served from Google App\n Engine.\n \u003c/p\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n\nDeploying your application to App Engine\n----------------------------------------\n\nWhen you deploy your application files, your website will be uploaded to App\nEngine. To deploy your app, run the following command from within the root\ndirectory of your application where the `app.yaml` file is located: \n\n gcloud app deploy\n\nOptional flags:\n\n- Include the `--project` flag to specify an alternate Google Cloud console project ID to what you initialized as the default in the gcloud CLI. Example: `--project [YOUR_PROJECT_ID]`\n- Include the `-v` flag to specify a version ID, otherwise one is generated for you. Example: `-v [YOUR_VERSION_ID]`\n\nTo learn more about deploying your app from the command line, see\n[Deploying your application](/appengine/docs/standard/testing-and-deploying-your-app#deploying_your_application).\n\nViewing your application\n------------------------\n\nTo launch your browser and view the app at\n`https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`, run the\nfollowing command: \n\n gcloud app browse\n\nWhat's next\n-----------\n\n[Serve your App Engine hosted website from a custom domain](/appengine/docs/standard/mapping-custom-domains)."]]