百度智能云

All Product Document

          CDN

          Forward-to-origin Configuration

          Origin Configuration

          1.Log into the CDN Management Console and enter the “Content Delivery Network (CDN)" page.

          2.Click Domain Name Management on the left navigation bar.

          3.Enter the domain name management page, and click the Management of the target domain name operation column.

          4.Enter the “CDN Domain Name Details " page, and select the Origin Configuration tab in the navigation bar at the top of the page.

          5.Enter the origin configuration page, and click Edit in the setting module of Origin Configuration.

          6.Configure the forward-to-origin domain name as Accelerated Domain Name, Origin server Domain Name or Customized Domain Name.

          image.png

          7.After clicking Save, you can see that the Forward-to-origin Configuration has been set successfully in the module of forward-to-origin configuration. A message indicating that "the configuration has been updated successfully, and will take effect in about five minutes" will appear on the page.

          Forward to Origin and Track 301/302

          Baidu AI Cloud CDN provides forward-to-origin following 301/302 configuration feature for you. When the node forwarded request returns 301/302 status code, the CDN node directly requests the resource from the redirected address without returning 301/302 to the user.

          1.Log into the CDN Management Console and enter the “Content Delivery Network (CDN)" page. 2.Click Domain Name Management on the left navigation bar. 3.Enter the domain name management page, and click the Management of the target domain name operation column. 4.Enter the “CDN Domain Name Details " page, and select the Origin Configuration tab in the navigation bar at the top of the page. 5.Enter the forward-to-origin configuration page, select Forward to Origin and Track 301/302 to set On/Off of the module.

          • Enable to "Forward to origin and track 301/302": When the user issues a request to get the resource of address A, if the node receives status code 302, it redirects to the new address and gets the resource. After the resource is got, cache it to the node and return the resource to the user. When other users also send a request to the A address resource, hit it in the node and return it to user.
          • Turn off “origin follow 301/302 ": When the user initiates the request and the node receives the status code 302, it will return HTTP Response to user. When other users also initiate request to such resource, repeat the above-mentioned steps.
          • Note: After the origin follow 301/302 feature is enabled, it only follows 3 redirections at most. If it exceeds the limit, it directly returns 301/302 to the user.

          Range Forward to Origin

          CDN provides the user with Range forward-to-origin configuration. Range is the Http request header, and is used for requests to the specific part of the file. E.g.: Range: bytes=0-999 is the first 1,000 bytes of the requested file. Enabling the Range forward-to-origin feature can reduce the consumption of forward-to-origin traffic, which can effectively improve the distribution efficiency of large files and enhance the response speed.

          1. Log into the CDN Management Console and enter the “Content Delivery Network (CDN) " page.
          2. Click Domain Name Management on the left navigation bar.
          3. Enter the domain name management page, and click the Management of the target domain name operation column.
          4. Enter the “CDN Domain Name Details " page, and select the Origin Configuration tab in the navigation bar at the top of the page.
          5. Enter the forward-to-origin configuration page, select Range Forward to Origin to set On/Off of the module. This feature requires the origin server to support Range request; otherwise, it may cause failure to forward to origin.
          Range forward-to-origin status Example
          Enable If User A requests the resource: http://www.bcetest.com/test.png, after the node receives the request, when it needs to forward to origin when it misses the node cache, or the cache expires, etc., the node initiates a forwarded request with Range, gets resources in fragments, which are cached and returned to the user.
          Disable If User A requests the resource: http://www.bcetest.com/test.png, after the node receives the request, when it needs to forward to origin when it misses the node cache, or the cache expires, etc., the node initiates a forwarded request without Range, which are cached and returned to the user. At this time, if User A's request has a Range, there may be problems with forward-to-origin amplification and slow response. Forward-to-origin amplification: For example, if User A requests 7-8M resources, the node forward-to-origin will be amplified to the entire resource. Slow response: For example, User A requests 7-8M resources, and the node forward-to-origin needs to get 0-7M data before responding to the client's body content.

          Private Bucket Forwarding to Origin

          The origin server is BOS and the Bucket is set as private. When CDN acceleration is enabled, you cannot access the Bucket resources by accessing the CDN accelerated domain name. If you want CDN to access private BOS Bucket, you can enable "Forward Private Bucket to Origin" in the "Forward-to-Origin Configuration" to authorize CDN, and then CDN will be forwarded back to private BOS Bucket. Such function can enable the user to protect the resources of origin server, while achieving the effect of using CDN for acceleration.

          1. Log into the CDN Management Console and enter the “Content Delivery Network (CDN)" page.
          2. Click Domain Name Management on the left navigation bar.
          3. Enter the domain name management page, and click the Management of the target domain name operation column.
          4. Enter the “CDN Domain Name Details " page, and select the Origin Configuration tab in the navigation bar at the top of the page.
          5. Enter the forward-to-origin configuration page, select Private Bucket Forward to Origin to set On/Off of the module.

          Forward-to-origin Protocol

          You can configure the forward-to-origin protocol through this feature, and forward the specified protocol to port 80 or port 443 to the origin server (the configuration of custom port will lose efficacy).

          1.Log into the CDN Management Console and enter the “Content Delivery Network (CDN)" page.

          2.Click Domain Name Management on the left navigation bar.

          3.Enter the domain name management page, and click the Management of the target domain name operation column.

          4.Enter the “CDN Domain Name Details " page, and select the Origin Configuration tab in the navigation bar at the top of the page.

          5.Enter the origin configuration page, and click Edit in the setting module of Origin Protocol.

          6.Select the forward-to-origin protocol, and by default, CDN node takes HTTP protocol for forwarding to origin.

          • Follow: After the selection, CDN node forwards the protocol to origin and keep consistent with the client's request protocol;
          • HTTP: After the selection, CDN node forces the forward-to-origin of HTTP protocol to be consistent with the client's request protocol;
          • HTTPS: After the selection, CDN node forces the forward-to-origin of HTTPS protocol to be consistent with the client's request protocol;

          Note: Only when “HTTPS configuration” of the domain name is completed and enabled, you can select the “HTTPS” option.

          7.After clicking Save, you can see that the Origin Protocol was successfully set in the origin protocol module, and the page prompts “Configuration was updated successfully, and it takes effect in about 5 minutes. "

          Get Real User IP

          1. Log into the CDN Management Console and enter the “Content Delivery Network (CDN)” page.
          2. Click Domain Name Management on the left navigation bar.
          3. Enter the domain name management page, and click the Management of the target domain name operation column.
          4. Enter the “CDN Domain Name Details” page, and select the Returning Source Configuration tab in the navigation bar at the top of the page.
          5. Enter the forward-to-origin configuration page, and click Edit for the Get Real User IP Setting Module.
          6. Adjust “Get Real User IP” be Enabled status and set type:

            • Client IP: The origin server can get the client IP address of the access source, carrying True-Client-Ip;
            • Real IP: The origin server can access the client IP address of access source, carrying X-Real-IP.

          7.After clicking Save, you can see that Access to IP of Real User has been enabled successfully in the module of access(ing) to IP of real user. A message indicating that "the configuration has been updated successfully, and will take effect in about five minutes" will appear on the page.

          Previous
          HTTPS Configuration
          Next
          Advanced Setting