Configure a rule
Set a descriptive name, path pattern, priority weight, and active state. Choose an origin-protocol override if required, then configure only the supported options for that rule. Disabled rules remain saved without being applied. Read the current configuration before editing. API updates replace the rule configuration, so preserve the settings you want to keep. Test both matching and nonmatching URLs and inspect their response headers before using the rule for production traffic.API
Use/cloud-cdn/distributions/rules?distribution=42. GET returns rules and limit. POST creates a rule. PUT and DELETE also require the rule query parameter. Writes require Modify distribution permission.
A write body contains name, pattern, weight, active, origin_protocol, and options. An empty origin protocol inherits the distribution’s setting. The API validates supported option names and shapes; unknown options are rejected. Rule-level Brotli requires Origin Shield to be enabled.
For application security policies, use Cloud Shield rules.