CDN 用戶操作
CDN User Guide
CDN User Guide
  • Domain Management
    • Add Domain
    • Batch Modify Upstream
    • Batch Remove Specific Domains
    • Export Site Records
  • Modules
    • Site Certificate
    • Token Auth
    • Custom Header
    • Redirects
    • CORS Setting
    • Proxy Rewrite
  • Site Settings
    • Cache Setting
    • Compress
    • Rates Limit
    • DNS API
    • Ports
  • Firewall
    • Whitelist Setting
    • Blacklist Setting
    • Positions Setting
    • Anti CC Setting
    • Interval Freq. Limit
    • Second Freq. Limit
    • User Agent Setting
  • ACL
  • Block List
  • Error Pages
  • Site Info.
Powered by GitBook
On this page
  1. Modules

CORS Setting

PreviousRedirectsNextProxy Rewrite

Last updated 6 months ago

CORS (Cross-Origin Resource Sharing) allows web pages to make requests to different domains than the one the web page was loaded from. It works by adding HTTP headers to the response which indicate if the origin is allowed to access the resource. The browser checks these headers to decide if the request should be allowed or blocked.

How to set up CORS?

  • Navigate to Sites -> Sites Settings -> Modules -> CORS Configuration

  • Click on Add CORS

  • Go to Navigate to Sites -> Sites Settings -> Domains

  • In the domain settings, apply the configuration to the desired domain.

Adding CORS Configuration - Field Descriptions:

  • Name: Custom name for the CORS configuration.

  • Allow Origins: Define which origins are allowed to access your resources.

    • Example parameters:

      • * (Allow all origins)

      • https://test.com (Allow only https://test.com to access)

      • https://* (Allow all HTTPS origins)

      • http://* (Allow all HTTP origins)

  • Access-Control-Allow-Methods: Specify the HTTP methods that are allowed.

    • Default supported methods:

      • GET

      • HEAD

      • POST

      • PUT

      • DELETE

      • OPTIONS

      • PATCH

  • Access-Control-Max-Age: Set the cache time for preflight requests in seconds. The default is 86400 (one day).

  • Allow Headers: Specify which custom headers are allowed in the request.

    • Example parameters:

      • * (Allow all headers)

      • Keep-Alive

      • User-Agent

  • Expose Headers: List the headers that the client can access from the response.

    • Example parameters:

      • * (Expose all headers)

      • Cache-Control

      • Content-Language