Skip to main content

tigris buckets set-cors

Configure CORS rules on a bucket. Each invocation adds a rule unless --override or --reset is used.

Usage

tigris buckets set-cors <name> [flags]
t3 b set-cors <name> [flags]

Flags

NameRequiredDefaultDescription
--originsNoAllowed origins (comma-separated, or * for all)
--methodsNoAllowed HTTP methods (comma-separated, e.g. GET,POST,PUT)
--headersNoAllowed request headers (comma-separated, or * for all)
--expose-headersNoResponse headers to expose (comma-separated)
--max-ageNo3600Preflight cache duration in seconds
--overrideNoReplace all existing CORS rules instead of appending
--resetNoClear all CORS rules on the bucket

Examples

# Allow all origins for GET and HEAD
tigris buckets set-cors my-bucket --origins '*' --methods GET,HEAD

# Allow a specific origin with custom headers
tigris buckets set-cors my-bucket \
--origins https://example.com \
--methods GET,POST \
--headers Content-Type,Authorization \
--max-age 3600

# Replace all existing CORS rules
tigris buckets set-cors my-bucket --origins https://example.com --override

# Clear all CORS rules
tigris buckets set-cors my-bucket --reset