All Products
Search
Document Center

:Unable to configure custom ports for Alibaba Cloud Content Delivery Network or D Alibaba Cloud Content Delivery Network

Last Updated:Jan 17, 2022

Problem description

The origin server generally uses standard ports (i. e. ports 80 and 443). If the origin server uses a non-standard port, configure it in the Alibaba Cloud CDN or DCDN (Dynamic Route for CDN) console to implement access acceleration, you will encounter a situation that cannot be configured or cannot be accessed normally after the custom port is configured.

Possible causes

The Alibaba Cloud Content Delivery Network or D Alibaba Cloud Content Delivery Network supports configuring custom ports. However, this feature only supports back-to-origin using HTTP.

Solution

Select a solution based on the product used in the current environment.

Alibaba Cloud Content Delivery Network the configuration of custom ports

Follow these steps to configure the custom port of the Alibaba Cloud Content Delivery Network. For more information, see Alibaba Cloud Content Delivery Network origin server configuration.

  1. Log on to the Alibaba Cloud Content Delivery Network console. In the left-side navigation pane, click Domain Names.
  2. On the Domain Names page, find the target domain name and click Manage.
  3. In the left-side navigation pane of the specified domain name, click Back-to-origin Configuration.
  4. In the Back-to-Origin Protocol section, turn on the Back-to-Origin Protocol switch.
  5. Click Modify.
  6. In the Static Protocol Follow Back-to-Origin dialog box, set Back-to-Origin protocol type to the HTTP and click OK.
  7. In the Origin Information section of the Basic Settings page, click Edit in the Actions column.
  8. In the Add Origin Information dialog box that appears, enter a port number and click OK.
    Note: If you need to Alibaba Cloud Content Delivery Network a custom port that uses HTTPS to return to the origin server, submit a ticket.

Configuration of DCDN Custom Ports

Follow these steps to configure the custom port of the Dynamic Route for CDN. For more information, see DCDN origin server configuration.

  1. Log on to the Dynamic Route for CDN console. In the left-side navigation pane, click Domain Names.
  2. On the Domain Names page, find the target domain name and click Configure.
  3. In the left-side navigation pane of the specified domain name, click Dynamic and Static Acceleration Rules.
  4. Click the Dynamic Content Back-to-Origin Configuration tab.
  5. In the Dynamic Content Protocol step, click Modify Configuration.
  6. In the Dynamic Content Protocol Follow Back-to-Origin dialog box, set Follow Mode.
  7. In the window that appears, select HTTP and click OK.
  8. On the Back-to-Origin Configuration page, turn on the Static Protocol Follow Back-to-Origin switch, and then click Modify.
  9. In the Static Protocol Follow Back-to-Origin dialog box, set Back-to-Origin protocol type to the HTTP and click OK.
  10. In the Origin Information section of the Basic Settings section, click Edit.
  11. In the Add Origin Information dialog box, set the following parameters.
  12. In the Add Origin Information dialog box that appears, enter a port number and click OK.

References

When you use Alibaba Cloud Content Delivery Network to accelerate access, the request process is as follows.

Note: This article takes Alibaba Cloud Content Delivery Network as an example. D Alibaba Cloud Content Delivery Network is the same as Alibaba Cloud Content Delivery Network.

Client> Alibaba Cloud Content Delivery Network> Origin
  1. When the client interacts with the Alibaba Cloud Content Delivery Network, the Alibaba Cloud Content Delivery Network acts as a server and only provides services on ports 80 and 443. In other words, the client can only access port 80 or 443 of the Alibaba Cloud Content Delivery Network. For example, Alibaba Cloud Content Delivery Network the accelerated domain name is example.aliyundoc.com, the request for the following form of network address will fail because the Alibaba Cloud Content Delivery Network does not provide port 9060 services.
    http://example.aliyundoc.com:9060
  2. When the Alibaba Cloud Content Delivery Network requests the origin, the Alibaba Cloud Content Delivery Network acts as a client to request the origin. Specifies which port to request the origin. You must view the port number configured for the origin in the console. To accelerate custom ports, see this topic.
  3. If you need to accelerate port 9060 of the origin server example.aliyundoc.com this Alibaba Cloud Content Delivery Network accelerated domain name, configure custom port 9060 and use http://example.aliyundoc.com to access it. During the actual request, the client will request port 80 of the Alibaba Cloud Content Delivery Network, and the Alibaba Cloud Content Delivery Network will request port 9060 of the origin.
    Note: You do not need to add a port number or use a http://example.aliyundoc.com:9060 to access the URL.

Other precautions are as follows:

  • You can only use HTTP to back-to-back ports. You must first configure the static protocol followed by back-to-origin as the HTTP protocol. For more information, see Configure the back-to-origin protocol. Configure the custom port. If this is Dynamic Route for CDN, you must set the protocol of the dynamic and static acceleration rule to follow back-to-origin to HTTP. Otherwise, the options of the custom port are gray and unclickable. For more information about how to set the protocol of the dynamic and static acceleration rule to follow back-to-origin to HTTP, see Configure the protocol to follow back-to-origin.
  • If your static protocol is set to Follow, you cannot configure a custom port.
  • If you set the back-to-origin protocol to Follow through the API operation, make sure that your back-to-origin protocol and custom port are properly used.

Applicable scope

  • CDN
  • Dynamic Route for CDN