All Products
Search
Document Center

ApsaraVideo Live:Configure HTTP headers

Last Updated:Feb 05, 2024

HTTP headers are components of the header section of request and response messages that are transmitted over HTTP. HTTP headers define the resources that are being requested and the behaviors of clients or servers. This topic describes how to configure HTTP headers.

Usage notes

  • The configurations of HTTP headers for an accelerated domain name affect how a client responds to all the requests that are destined for the domain name. The client can be a browser. The header configurations do not affect the cache server.

  • You cannot configure HTTP headers for wildcard domain names.

  • If you want to implement cross-origin playback, you must set the Access-Control-Allow-Origin header to an asterisk (*) or a complete domain name that you want to access, such as www.aliyundoc.com. Take note that if you want to allow cross-origin access for multiple domain names, set the header to an asterisk (*).

Procedure

  1. Log on to the ApsaraVideo Live console.
  2. In the left-side navigation pane, click Domains to go to the Domain Management page.
  3. Find the streaming domain that you want to configure and click Domain Settings in the Actions column.

    001

  4. Choose Streaming Management > HTTP Header Settings.

  5. Click Add.

  6. In the HTTP Header Settings dialog box, select a header from the Header drop-down list, enter a value in the Value field, and click OK.

    配置HTTP头

    The following table describes the headers that you can select.

    Header

    Description

    Example value

    Content-Type

    The media type of the resource that is returned to the client.

    image

    Cache-Control

    The cache rule that requests and responses follow.

    no-cache

    Content-Disposition

    The default file name that is used when the retrieved content is saved as a file on the client.

    123.txt

    Content-Language

    The language of the intended audience for the content that is returned to the client.

    zh-CN

    Expires

    The expiration time of the content that is returned to the client.

    Wed, 21 Oct 2015 07:28:00 GMT

    Access-Control-Allow-Origin

    The origins from which cross-origin requests are allowed.

    *

    Note

    You can enter an asterisk (*) to specify all domain names. You can also enter a complete domain name, such as www.aliyundoc.com.

    Access-Control-Allow-Headers

    The headers that are allowed in cross-origin requests.

    X-Custom-Header

    Access-Control-Allow-Methods

    The request methods that you can use in cross-origin requests.

    POST and GET

    Note

    To add both the POST and GET methods, separate them with a comma (,).

    Access-Control-Max-Age

    The time to live (TTL) during which the response can be cached for a preflight request that is initiated by the client for a particular resource. Unit: seconds.

    600

    Access-Control-Expose-Headers

    The headers that can be exposed as part of the response.

    Content-Length