Configure an External CDN or Third-Party Proxy

You can use your own content delivery network (CDN) with Salesforce B2C Commerce's embedded CDN to deliver static and dynamic content to your customers. Deploy your CDN (or a reverse proxy) in front of B2C Commerce to improve performance and security, or to provide extra functionality using your CDN.

Customer CDN settings are instance-specific. They aren’t transferred to other instances with the Data Replication process.

Layer your CDN in front of the B2C Commerce platform. Specify the URL prefix used to create the URLs pointing to your CDN.

Important: If you are leveraging only the embedded CDN that is included in B2C Commerce, don't change the following settings.
  1. Select site > Merchant Tools > SEO > Customer CDN Settings.
    The Customer Content Delivery Network Settings page opens.
  2. In the Dynamic Content section, enter the Client IP Header Name.
    The CDN uses the Client IP Header value to transfer the client's IP address to enable client IP-based services, such as geo-location. B2C Commerce uses this setting to retrieve the client IP address from a request header instead of the network connection source address. If the request header isn't provided, the connection source address is used. If a CDN terminates client requests, B2C Commerce continues to use the client IP header name functionality.
    Note: B2C Commerce prohibits use of the following header names, regardless of capitalization or if you replace the dashes with underscores:
    • cf-connecting-ip
    • true-client-ip
    • x-forwarded-for
  3. In Business Manager, select site > Merchant Tools > SEO > Aliases and configure the site name.
  4. Click Save (at the top right).
Note: Sometimes, the eCDN can try to prevent a DDOS attack, or attempt to mitigate an application attack. Under these circumstances, the eCDN security feature can view the third-party proxy as the offending IP address or server. As a result, the eCDN can seek to block the third-party server and potentially block more users than expected.

To mitigate the eCDN security response, we recommend that you add your stacked proxy to the firewall allowlist. To access the allowlist, go to Administration > Sites > Embedded CDN Settings, and click Settings for the desired zone. In the Firewall tab, add or edit the allowlist and specify any third-party proxy IP addresses.

After defining the Client IP Header Name and site aliases, complete the configuration by configuring your DNS and your external third-party proxy.

To configure a third-party proxy on top of the B2C Commerce platform:

  1. On the third-party proxy:
    1. Enter the B2C Commerce instance as the origin server, for example, your-domain.cdn.cloudflare.net
    2. Pass the host header (for example, www.customer.com) back to the eCDN.
      Note: Don’t send the entire B2C Commerce instance (www.customer.com.cdn.cloudflare.net) back to the eCDN.
    3. Configure the client IP header name as specified.
    4. Ensure that responses are only cached in the CDN if the origin sends a cache header.
  2. On the DNS, point the DNS entry for your site to your CDN CNAME.