Skip to main content

Configure CORS

FastGateway supports CORS configuration to control cross-origin requests to your APIs.

The Security tab of the route builder, where CORS Configuration sits alongside IP allowlisting, API key, JWT, and OIDC

Configure in the UI​

  1. In the route builder, open the Security tab.
  2. Expand CORS Configuration and check Enable CORS.
  3. Fill in the fields below:
    • Allowed Origins: a comma-separated list of origins. Wildcards are supported.
    • Allowed Methods: check the HTTP methods to allow (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS).
    • Allowed Headers: a comma-separated list of request headers clients may send.
    • Expose Headers: a comma-separated list of response headers the browser is allowed to read.
    • Max Age (seconds): how long browsers cache the preflight response.
    • Allow Credentials: check Allow cookies and credentials if cookies or credentials are needed.
  4. Submit the route for approval. Once approved, the change deploys.

CORS Settings​

FieldDescription
Allowed OriginsOrigins allowed to access the resource
Allowed MethodsHTTP methods allowed for cross-origin requests
Allowed HeadersHeaders that can be used in the request
Expose HeadersHeaders exposed to the browser
Max Age (seconds)How long preflight results can be cached
Allow CredentialsWhether cookies and credentials are allowed

Wildcard Origins​

Use * in Allowed Origins to allow all origins. This is not recommended for production with credentials.

When Allow Credentials is enabled, you cannot use * for Allowed Origins. List explicit origins instead.

The REST API equivalent is documented in the API Reference.