このページは、まだ日本語ではご利用いただけません。翻訳中です。
古いプラグインバージョンのドキュメントを閲覧しています。
構成
このプラグインはDBレスモードに対応しています。
互換性のあるプロトコル
CORSプラグインは以下のプロトコルに対応しています:
grpc, grpcs, http, https
パラメータ
このプラグインの設定で使用できるすべてのパラメータのリストは次のとおりです。
-
name or plugin
string requiredプラグイン名。この場合は
cors。- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
nameです。 - Kubernetes で KongPlugin オブジェクトを使用する場合、フィールドは
pluginです。
- Kong Admin API、Kong Konnect API、宣言型構成、または decK ファイルを使用する場合、フィールドは
-
service.name or service.id
stringプラグインが対象とするサービス名または ID。最上位の
/pluginsエンドポイント. からプラグインをサービスに追加する場合は、これらのパラメータのいずれかを設定してください/services/{serviceName|Id}/pluginsを使用する場合は必要ありません。 -
route.name or route.id
stringプラグインがターゲットとするルート名または ID。最上位の
/pluginsエンドポイント. を通るルートにプラグインを追加する場合は、これらのパラメータのいずれかを設定してください/routes/{routeName|Id}/pluginsを使用する場合は必要ありません。 -
enabled
boolean default:trueこのプラグインが適用されるかどうか。
-
config
record required-
origins
array of typestringList of allowed domains for the
Access-Control-Allow-Originheader. 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.
-
headers
array of typestringValue for the
Access-Control-Allow-Headersheader.
-
exposed_headers
array of typestringValue for the
Access-Control-Expose-Headersheader. If not specified, no custom headers are exposed.
-
methods
array of typestringdefault:GET, HEAD, PUT, PATCH, POST, DELETE, OPTIONS, TRACE, CONNECTMust be one of:GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS,TRACE,CONNECT‘Value for the
Access-Control-Allow-Methodsheader. Available options includeGET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS,TRACE,CONNECT. By default, all options are allowed.’
-
max_age
numberIndicates how long the results of the preflight request can be cached, in
seconds.
-
credentials
boolean required default:falseFlag to determine whether the
Access-Control-Allow-Credentialsheader should be sent withtrueas the value.
-
preflight_continue
boolean required default:falseA boolean value that instructs the plugin to proxy the
OPTIONSpreflight request to the Upstream service.
-