Help Center> Cloud Connect> Best Practices> Accelerating Access to a Website Across Regions

Accelerating Access to a Website Across Regions

Scenarios

This practice provides detailed operations for accelerating access to a website across regions.

Components required in this scenario include a NAT gateway, a cloud connection, and a web proxy server.

Figure 1 shows the networking topology.

Figure 1 Networking

In this practice, an HTTP proxy server is used, such as a Squid proxy server, and it is only used for browser-based web access.

Proxy-Client: Use a Windows server with the web proxy installed as the client and set the proxy address to the EIP (114.119.xx.xx) in AP-Singapore.

NAT Gateway: Configure a DNAT rule to map the EIP (114.119.xx.xx) in AP-Singapore to the IP address (172.16.101.100) bound to the NIC (Eth 1) of the Squid proxy server in CN East-Shanghai1.

Prerequisites

  • Your cross-border permit has been approved.
  • You have deployed a proxy server based on your network conditions.

    In this practice, you need to configure the proxy server by yourself.

Procedure

  1. Create two VPCs and ensure that the VPC CIDR blocks do not conflict with each other.

    For details, see Creating a VPC.

    Add two subnets to the VPC in CN East-Shanghai1.

    • Subnet 1: 172.16.100.0/24
    • Subnet 2: 172.16.101.0/24

  2. Configure Cloud Connect.

    Create a cloud connection, load the VPCs, and add a custom CIDR block.

    1. Create a cloud connection.

      For details, see Creating a Cloud Connection.

    2. Load the VPCs.

      When you load the VPC in CN East-Shanghai1, select only subnet 2.

      For details, see Loading a Network Instance.

    3. Add a custom CIDR block.

      Add a custom CIDR block 0.0.0.0/0 for the VPC in AP-Singapore.

      For details, see Adding a Custom CIDR block.

      You need to add the default route 0.0.0.0/0 from the cloud connection to the NAT gateway.

    4. Buy a bandwidth package.

      By default, the system allocates 10 kbit/s of bandwidth for testing network connectivity across regions. You need to buy a bandwidth package to ensure normal network communications across regions.

      For details, see Buying a Bandwidth Package.

    5. Assign an inter-region bandwidth.

      For details, see Assigning Inter-Region Bandwidth.

  3. Buy an ECS with two NICs in CN East-Shanghai1.

    • Eth 0: 172.16.100.100
    • Eth 1: 172.16.101.100

    For details, see Purchasing an ECS.

    Bind an EIP to Eth 0 so that the ECS can access the Internet.

  4. Configure Squid on the ECS.

    1. To ensure normal routing, add a policy-based route for the ECS in CN East-Shanghai1.
    ip rule add from 172.16.101.100 table 100
    ip route add default via 172.16.101.1 table 100
    1. Install and configure Squid on the ECS in a secure and reliable manner based on your network requirements.

  5. Buy two EIPs and configure a NAT gateway.

    1. Buy an EIP in CN East-Shanghai1 and bind the EIP to Eth 0 (172.16.100.100).

      For details, see Assigning an EIP and Binding It to an ECS.

    2. Buy an EIP in AP-Singapore, purchase a NAT gateway, and add a DNAT rule. (Select Direct Connect/Cloud Connect when you add the DNAT rule.)

      For details, see Assigning an EIP and Binding It to an ECS and Adding a DNAT Rule.

    Private IP address: IP address (172.16.101.100) of the Eth 1

    EIP: EIP (114.119.XX.XX) used by Proxy-Client

    Squid proxy server: Eth 0 is used for Internet access, and Eth 1 is used for DNAT mapping.

    Configuring the DNAT rule enables the squid proxy server in the VPC to provide services accessible from the Internet. The proxy client allows access to the services provided by the Squid proxy server.

  1. Configure Proxy-Client.

    Prepare a Windows server and configure it as the client.

    1. Select Settings.
    2. Choose Network and Internet > Proxy > Manual proxy setup.
    3. Enable Use a proxy server.
    4. Set Address and Port.
      Figure 2 Proxy configuration

      Address: Enter the EIP (114.119.XX.XX) bound to the DNAT rule.

    5. Click Save.

Verification

After the configuration is complete, access the website from Proxy-Client to check whether access is normal.