a6-plugin-cors

Configure CORS plugin settings for Apache APISIX routes via a6 CLI.

1|2|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/moonming/a6 --skill a6-plugin-cors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: a6-plugin-cors
Source: https://github.com/moonming/a6/tree/main/skills/a6-plugin-cors
Command: npx skills add https://github.com/moonming/a6 --skill a6-plugin-cors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the configuration of Cross-Origin Resource Sharing (CORS) for Apache APISIX routes, enabling secure and controlled access to your APIs from different web domains.

Core Features & Use Cases

  • Flexible Origin Matching: Supports exact origins, wildcards (*, **), and regular expressions for granular control.
  • Credential Handling: Allows configuration for credentialed requests (cookies, auth headers).
  • Preflight Request Optimization: Manages OPTIONS requests and caching (max_age).
  • Use Case: Securely expose your APISIX-served API to a frontend application hosted on a different domain, ensuring only authorized origins can access it.

Quick Start

Configure the CORS plugin on a route to allow all origins and methods for public access.

Frequently Asked Questions about a6-plugin-cors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure CORS for an Apache APISIX route?

Configure CORS for Apache APISIX routes by attaching the CORS plugin to a specific route via the a6 CLI, defining access rules for origins, methods, headers, and credentials to securely expose your APIs.

Can I use regex for dynamic origin matching in APISIX CORS?

Yes, dynamic origin matching in APISIX CORS supports regular expressions, alongside exact origins and wildcards like `*` or `**`, allowing granular control over authorized cross-origin access to your API.

How does APISIX handle CORS preflight OPTIONS requests?

APISIX handles CORS preflight OPTIONS requests by managing the CORS plugin configuration, allowing you to optimize caching through the `max_age` setting to reduce repeated preflight traffic.

How do I allow credentialed cross-origin requests in APISIX?

Allow credentialed cross-origin requests in APISIX by configuring the CORS plugin on your route to explicitly permit credentials, enabling secure transmission of cookies and authorization headers from authorized origins.

What is the best way to secure APISIX API access for a frontend on a different domain?

The best way to secure APISIX API access for a cross-domain frontend is configuring the route-level CORS plugin to restrict access strictly to authorized origins, ensuring controlled resource sharing across domains.