hosting

PATCH /v1/sites/{siteId}/cdn/canonical-host

Choose www or non-www, and whether to force HTTPS.

ចំណុចបញ្ចប់ hosting ទាំងអស់

ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ

បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ hosting.cdn.manage។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។

ចំនុចបញ្ចប់នេះមិនត្រូវការលេខសម្គាល់ស្ថាប័នទេ។ ពស័្ដកូនរបស់អ្នករួចហើយកំណត់អត្តសញ្ញាណស្ថាប័នដែលវាជាកម្មសិទ្ធិ ហើយការឆ្លើយតបគឺត្រូវបានកំណត់វិសាលភាពទៅតាមនោះ។

សាកល្បង

ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។

curl -X PATCH https://api.zinndigital.com/v1/sites/{siteId}/cdn/canonical-host \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API

ព័ត៌មានលម្អិត

A **merge**: only the fields present in the body change. An absent field is left alone rather than reset, so a client written before one of these existed cannot switch it off on every save. `force_https` defaults to `true` on every new site. The insecure choice has to be made explicitly; it is never reached by omitting a field. A site whose primary domain is a **deeper subdomain** (`shop.blog.example.com`) has no `www` counterpart, and the request is a `422` rather than a stored preference whose plan can never be built. Refusing at write time is deliberate: the alternative saves cleanly and then fails later inside provisioning, where the customer sees a stuck deploy instead of the bad input. An empty body is a `422`, not a no-op success. Requires `hosting.cdn.manage`.

ប៉ារ៉ាម៉ែត្រ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
siteId (path)Uuidបាទ/ចាសSite ID (UUIDv7).

សំណើរបស់រាងកាយ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
canonical_hoststring<apex, www>ទេ
force_httpsbooleanទេ

ផ្អាកដំណើរការ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
canonical_hoststring<apex, www>បាទ/ចាស
force_httpsbooleanបាទ/ចាសRedirect http to https at the edge. Defaults to true on every new site.
serves_onstringបាទ/ចាសThe hostname that actually serves.
redirects_fromstringបាទ/ចាសThe hostname that permanently redirects to `serves_on`.
redirect_statusintegerបាទ/ចាសAlways 301. A 302 tells search engines to keep indexing the alias, which leaves the duplicate-content problem unsolved while looking correct in a browser.
certificate_hostsstring[]បាទ/ចាស**Both** hostnames, always. TLS is negotiated on the name being redirected from, so a certificate covering only `serves_on` puts a security interstitial in front of the alias an…
apex_deliverystring<native, alias, a_records, unsupported>បាទ/ចាសHow the zone apex is made to resolve. A bare apex cannot be a `CNAME`, so on a pull-zone CDN it resolves only through CNAME-flattening/ALIAS at the DNS provider, or through A/AA…
apex_deliverablebooleanបាទ/ចាស`false` when neither mechanism is available for this CDN/DNS pairing. The combination is refused rather than accepted, because the alternative provisions cleanly, reports health…

កំហុសដែលចំណុចបញ្ចប់នេះអាចបង្វិលត្រឡប់មកវិញ

401 · 403 · 404 · 422 · 429