REGION_ID는 앱을 만들 때 선택한 리전을 기준으로 Google에서 할당하는 축약된 코드입니다. 일부 리전 ID는 일반적으로 사용되는 국가 및 주/도 코드와 비슷하게 표시될 수 있지만 코드는 국가 또는 주/도와 일치하지 않습니다. 2020년 2월 이후에 생성된 앱의 경우 REGION_ID.r이 App Engine URL에 포함됩니다. 이 날짜 이전에 만든 기존 앱의 경우 URL에서 리전 ID는 선택사항입니다.
이 참조 페이지에서는 지원되는 HTTP 헤더에 대한 자세한 내용을 확인할 수 있습니다. App Engine이 요청을 수신하고 응답을 전송하는 방법은 요청 처리 방법을 참조하세요.
요청 헤더
수신되는 HTTP 요청에는 클라이언트가 전송한 HTTP 헤더가 포함되어 있습니다. 보안을 위해 일부 헤더는 애플리케이션에 도달하기 전에 중간 프록시에 의해 제거, 수정 또는 삭제됩니다.
수신 요청에서 헤더가 삭제됨
클라이언트가 헤더를 보내면 다음 헤더는 수신 요청에서 삭제됩니다.
헤더의 이름이 X-Google-* 패턴과 일치합니다. 이 이름 패턴은 Google에 예약되어 있습니다.
헤더의 이름이 App Engine 관련 헤더와 일치합니다. 대소문자를 구분하지 않는 일치 항목만 삭제됩니다. 예를 들어 X-Appengine-Country 또는 X-AppEngine-Country라는 헤더는 삭제되지만 X-Appengine-Cntry는 삭제되지 않습니다.
App Engine 관련 헤더
앱에 대한 서비스로서, App Engine은 다음 헤더를 모든 요청에 추가합니다.
X-Appengine-Country
ISO 3166-1 alpha-2 국가 코드로 표시되는 요청이 시작된 국가입니다.
App Engine은 클라이언트의 IP 주소로부터 이 코드를 확인합니다. 국가 정보는 WHOIS 데이터베이스에서 파생되지 않습니다. 따라서 WHOIS 데이터베이스의 국가 정보가 포함된 IP 주소가 X-Appengine-Country 헤더에 국가 정보가 없을 가능성이 있습니다. 애플리케이션은 특수 국가 코드 ZZ(알 수 없는 국가)를 처리해야 합니다.
X-Appengine-Region
요청이 시작된 리전의 이름입니다. 이 값은 X -Appengine-Country에 지정된 국가를 기준으로 적용됩니다. 예를 들어 국가가 'US'이고 지역이 'ca'일 때, 'ca'는 캐나다가 아닌 '캘리포니아'를 의미합니다. 유효한 리전 값의 전체 목록은 ISO-3166-2 표준을 참조하세요.
X-Appengine-City
요청이 시작된 도시의 이름입니다. 예를 들어 Mountain View 시의 요청은 헤더 값 mountain view를 가질 수 있습니다.
이 헤더에 유효한 값의 표준 목록은 없습니다. 도시를 확인할 수 없는 경우 헤더 값이 ?으로 설정됩니다.
X-Appengine-CityLatLong
요청이 시작된 도시의 위도 및 경도입니다. 이 문자열은 Mountain View에서의 요청의 경우 '37.386051,-122.083851'과 같이 표시될 수 있습니다.
도시를 확인할 수 없는 경우 헤더 값이 0.000000,0.000000으로 설정됩니다.
X-Cloud-Trace-Context
Cloud Trace 및 Cloud Logging에 사용된 요청의 고유 식별자입니다. 모든 App Engine 표준 환경 앱이 자동으로 추적되므로 이 헤더를 중지하거나 trace용 샘플링 레이트를 선택할 수 있는 옵션이 없습니다.
클라이언트 요청의 경로를 지정할 때 사용된 쉼표로 구분된 IP 주소 목록입니다. 이 목록의 첫 번째 IP는 일반적으로 요청을 만든 클라이언트의 IP입니다. 이후 IP는 애플리케이션 서버에 도달하기 전 요청을 처리하는 데 사용된 프록시 서버에 대한 정보를 제공합니다. 예를 들면 다음과 같습니다.
X-Forwarded-For: clientIp, proxy1Ip, proxy2Ip
X-Forwarded-Proto [http | https]
클라이언트가 애플리케이션에 연결하는 데 사용한 프로토콜을 기반으로 http 또는 https를 표시합니다.
Google Cloud 부하 분산기는 모든 https 연결을 종료한 후 http을 통해 App Engine 인스턴스로 트래픽을 전달합니다. 예를 들어 사용자가 https://PROJECT_ID.REGION_ID.r.appspot.com을 통해 사이트에 대한 액세스를 요청하면 X-Forwarded-Proto 헤더 값은 https가 됩니다.
또한 App Engine은 App Engine에서 내부적으로 사용하는 다음 헤더를 설정할 수 있습니다.
[[["이해하기 쉬움","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\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a code assigned by Google based on the selected region when creating an app, and it is included in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eFor security, certain HTTP headers sent by clients are removed from incoming requests, specifically those matching the \u003ccode\u003eX-Google-*\u003c/code\u003e pattern and exact matches of App Engine-specific header names like \u003ccode\u003eX-Appengine-Country\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine adds several specific headers to all requests, including \u003ccode\u003eX-Appengine-Country\u003c/code\u003e, \u003ccode\u003eX-Appengine-Region\u003c/code\u003e, \u003ccode\u003eX-Appengine-City\u003c/code\u003e, and \u003ccode\u003eX-Appengine-CityLatLong\u003c/code\u003e, which provide information about the request's origin.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eX-Forwarded-For\u003c/code\u003e header provides a comma-delimited list of IP addresses that the client request has been routed through, and \u003ccode\u003eX-Forwarded-Proto\u003c/code\u003e indicates the protocol used by the client to connect.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine also sets headers, for internal use, such as \u003ccode\u003eX-Appengine-Https\u003c/code\u003e, \u003ccode\u003eX-Appengine-User-IP\u003c/code\u003e, \u003ccode\u003eX-Appengine-Api-Ticket\u003c/code\u003e, \u003ccode\u003eX-Appengine-Request-Log-Id\u003c/code\u003e, \u003ccode\u003eX-Appengine-Default-Version-Hostname\u003c/code\u003e, and \u003ccode\u003eX-Appengine-Timeout-Ms\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Request headers\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\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/flexible/python/how-requests-are-routed#region-id). \nOK\n\nUse this reference page for details about what HTTP headers are supported\n. To understand how App Engine receives\nrequests and sends responses, see [How Requests Are\nHandled](/appengine/docs/flexible/how-requests-are-handled).\n\nRequest headers\n---------------\n\nAn incoming HTTP request includes the HTTP headers sent by the client. For\nsecurity purposes, some headers are sanitized, amended, or removed by\nintermediate proxies before they reach the application.\n\n### Headers removed from incoming requests\n\nThe following headers are removed from incoming requests if a client sends them:\n\n- Headers with names that match the `X-Google-*` pattern. This name pattern\n is reserved for Google.\n\n- Headers with names that match\n [App Engine-specific headers](#app_engine-specific_headers). Only\n exact, case-insensitive matches are removed. For example, headers named\n `X-Appengine-Country` or `X-AppEngine-Country` will be removed but\n `X-Appengine-Cntry` will not.\n\n### App Engine-specific headers\n\nAs a service to the app, App Engine adds the following headers to all requests:\n\n`X-Appengine-Country`\n: Country from which the request originated, as an [ISO 3166-1\n alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.\n App Engine determines this code from the client's IP address. Note that\n the country information is not derived from the WHOIS database; it's possible\n that an IP address with country information in the WHOIS database will not have\n country information in the `X-Appengine-Country` header. Your application should\n handle the special country code `ZZ` (unknown country).\n\n`X-Appengine-Region`\n: Name of region from which the request originated. This value only makes\n sense in the context of the country in `X -Appengine-Country`. For example, if\n the country is \"US\" and the region is \"ca\", that \"ca\" means \"California\", not\n Canada. The complete list of valid region values is found in the\n [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard.\n\n`X-Appengine-City`\n: Name of the city from which the request originated. For example, a request\n from the city of Mountain View might have the header value `mountain view`.\n There is no canonical list of valid values for this header. If the city can't\n be resolved, the header value is set to `?`.\n\n`X-Appengine-CityLatLong`\n: Latitude and longitude of the city from which the request originated. This\n string might look like \"37.386051,-122.083851\" for a request from Mountain View.\n If the city can't be resolved, the header value is set to `0.000000,0.000000`.\n\n`X-Cloud-Trace-Context`\n: A unique identifier for the request used for [Cloud Trace](/trace)\n and [Cloud Logging](/logging). There isn't an option to disable this header\n or choose the sampling rate for tracing since all App Engine standard environment apps are traced\n automatically.\n\n`X-Forwarded-For: [CLIENT_IP(s)], [global forwarding rule IP]`\n\n: A comma-delimited list of IP addresses through which the client request has\n been routed. The first IP in this list is generally the IP of the client that\n created the request. The subsequent IPs provide information about proxy servers\n that also handled the request before it reached the application server. For\n example:\n\n X-Forwarded-For: clientIp, proxy1Ip, proxy2Ip\n\n`X-Forwarded-Proto [http | https]`\n\n: Shows `http` or `https` based on the protocol the client used to connect to\n your application.\n\n The Google Cloud Load Balancer terminates all `https` connections, and then\n forwards traffic to App Engine instances over `http`. For example, if a user\n requests access to your site via\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`, the X-\n Forwarded-Proto header value is `https`.\n\nIn addition, App Engine may set the following headers which are for\ninternal use by App Engine:\n\n- `X-Appengine-Https`\n- `X-Appengine-User-IP`\n- `X-Appengine-Api-Ticket`\n- `X-Appengine-Request-Log-Id`\n- `X-Appengine-Default-Version-Hostname`\n- `X-Appengine-Timeout-Ms`\n\n\u003cbr /\u003e"]]