📗
Janus Manual
  • Introduction
  • Installation
    • Docker
  • Quick Start
    • Authenticating
    • Add an endpoint
    • Modify (Update/Delete) an endpoint
    • Add Plugins
    • Authentication
    • Adding your API - File System
  • Clustering/HA
  • Proxy Reference
    • Terminology
    • Overview
    • Routing capabilities
    • Load Balacing
    • Request Host header
      • Using wildcard hostnames
      • The preserve_host property
    • Request URI
      • The strip_path property
      • The append_path property
    • Request HTTP method
    • Routing priorities
    • Conclusion
  • Plugins
    • Basic
    • Organization
    • Body Limit
    • Circuit Breaker
    • Compression
    • CORS
    • OAuth
    • Rate Limit
    • Request Transformer
    • Response Transformer
    • Retry
  • Auth
    • OAuth 2.0
  • Misc
    • Health Checks
    • Monitoring
    • Tracing
  • Known Issues
    • Stale HTTP Keep-Alive
  • Upgrade Notes
    • 2.x to 3.x
    • 3.6.x to 3.7.x
Powered by GitBook
On this page

Was this helpful?

  1. Plugins

CORS

Easily add Cross-origin resource sharing (CORS) to your API by enabling this plugin.

Configuration

The plain cors config:

"cors": {
    "enabled": true,
    "config": {
        "domains": ["*"],
        "methods": ["GET", "POST"],
        "request_headers": ["X-Custom-Header", "X-Foobar"],
        "exposed_headers": ["X-Something-Special"],
        "options_passthrough": true
    }
}

Configuration

Description

domains

A comma-separated list of allowed domains for the Access-Control-Allow-Origin header. If you wish to allow all origins, add * as a single value to this configuration field.

methods

Value for the Access-Control-Allow-Methods header, expects a comma delimited string (e.g. GET,POST).

request_headers

Value for the Access-Control-Allow-Headers header, expects a comma delimited string (e.g. Origin, Authorization).

exposed_headers

Value for the Access-Control-Expose-Headers header, expects a comma delimited string (e.g. Origin, Authorization). If not specified, no custom headers are exposed.

options_passthrough

Instructs preflight to let other potential next handlers to process the OPTIONS method.

PreviousCompressionNextOAuth

Last updated 4 years ago

Was this helpful?