CORS 정책 구성 참조
CORS 정책 구성 참조 (CORS Policy Configuration Reference)
이 문서는 Kong에서 CORS 정책을 구성할 때 설정할 수 있는 모든 옵션을 참조 형식으로 정리해 줘요. 허용 오리진(origins), 허용 및 노출 헤더, HTTP 메서드, 프리플라이트 캐시 시간(max_age), 자격 증명 허용 여부 같은 각 필드의 타입과 기본값, 설명을 한눈에 확인할 수 있어요. CORS 동작을 세밀하게 제어하고 싶다면 이 참조를 보면서 필요한 값을 하나씩 설정하면 돼요
출처: 문서
본문
{
"properties": {
"config": {
"type": "object",
"properties": {
"origins": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of allowed domains for the `Access-Control-Allow-Origin` header. If you want to allow all origins, add `*` as a single value to this configuration field. The accepted values can either be flat strings or PCRE regexes. NOTE: If you don't specify any allowed domains, all origins are allowed."
},
"headers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Value for the `Access-Control-Allow-Headers` header."
},
"exposed_headers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Value for the `Access-Control-Expose-Headers` header. If not specified, no custom headers are exposed."
},
"methods": {
"type": "array",
"items": {
"type": "string",
"enum": [
"CONNECT",
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"PUT",
"TRACE"
]
},
"description": "'Value for the `Access-Control-Allow-Methods` header. Available options include `GET`, `HEAD`, `PUT`, `PATCH`, `POST`, `DELETE`, `OPTIONS`, `TRACE`, `CONNECT`. By default, all options are allowed.'",
"default": [
"CONNECT",
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"PUT",
"TRACE"
]
},
"max_age": {
"type": "number",
"description": "Indicates how long the results of the preflight request can be cached, in `seconds`."
},
"private_network": {
"type": "boolean",
"description": "Flag to determine whether the `Access-Control-Allow-Private-Network` header should be sent with `true` as the value.",
"default": false
},
"preflight_continue": {
"type": "boolean",
"description": "A boolean value that instructs the policy to proxy the `OPTIONS` preflight request to the Upstream service.",
"default": false
},
"credentials": {
"type": "boolean",
"description": "Flag to determine whether the `Access-Control-Allow-Credentials` header should be sent with `true` as the value.",
"default": false
},
"allow_origin_absent": {
"type": "boolean",
"description": "A boolean value that skip cors response headers when origin header of request is empty",
"default": true
}
}
}
}
}
관련 리소스
더 알아보기 (Learn more)
- 정책을 엔터티로 정의하고 관리하는 방식을 설명하는 문서예요 — AI Policy entity
- AI 모델 엔터티의 구성을 다루는 문서예요 — AI Model entity
- AI 에이전트 엔터티의 개념과 구성을 소개하는 문서예요 — AI Agent entity
- AI MCP 서버 엔터티를 설명하는 문서예요 — AI MCP Server entity