このページは、まだ日本語ではご利用いただけません。翻訳中です。
構成
このプラグインはDBレスモードに対応しています。
互換性のあるプロトコル
CORSプラグインは以下のプロトコルに対応しています:
grpc
, grpcs
, http
, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
string required
プラグイン名。この場合は
cors
。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
name
です。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
plugin
です。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
string
プラグインのインスタンスを識別するための任意のカスタム名 (例:
cors_my-service
。インスタンス名はKong ManagerとKonnectに表示されるので、 例えば複数のサービスで同じプラグインを複数のコンテキストで実行する場合に便利です。また、Kong Admin API経由で特定のプラグインインスタンスに アクセスするためにも使用できます。
インスタンス名は、次のコンテキスト内で一意である必要があります。
- Kong Gateway Enterpriseのワークスペース内
- Konnectのコントロールプレーン(CP)またはコントロールプレーン(CP)グループ内
- Kong Gateway (OSS)の全世界
-
string
プラグインが対象とするサービス名または ID。最上位の
/plugins
エンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/plugins
を使用する場合は必要ありません。 -
string
プラグインがターゲットとするルート名または ID。最上位の
/plugins
エンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/plugins
を使用する場合は必要ありません。 -
boolean default:
true
このプラグインが適用されるかどうか。
-
record required
-
array of type
string
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.
-
array of type
string
Value for the
Access-Control-Allow-Headers
header.
-
array of type
string
Value for the
Access-Control-Expose-Headers
header. If not specified, no custom headers are exposed.
-
array of type
string
default:GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS, TRACE, CONNECT
Must be one of:GET
,HEAD
,PUT
,PATCH
,POST
,DELETE
,OPTIONS
,TRACE
,CONNECT
‘Value for the
Access-Control-Allow-Methods
header. Available options includeGET
,HEAD
,PUT
,PATCH
,POST
,DELETE
,OPTIONS
,TRACE
,CONNECT
. By default, all options are allowed.’
-
number
Indicates how long the results of the preflight request can be cached, in
seconds
.
-
boolean required default:
false
Flag to determine whether the
Access-Control-Allow-Credentials
header should be sent withtrue
as the value.
-
boolean required default:
false
Flag to determine whether the
Access-Control-Allow-Private-Network
header should be sent withtrue
as the value.
-
boolean required default:
false
A boolean value that instructs the plugin to proxy the
OPTIONS
preflight request to the Upstream service.
-