Configure Azure CDN as Reverse Proxy

Availability varies by Auth0 plan

Your Auth0 plan or custom agreement affects whether this feature is available. To learn more, read Pricing.

To set up Azure CDN as a reverse proxy, an Azure CDN Premium plan is required.

  1. Configure Custom Domains with Self-Managed Certificates if you haven't already. Make note of the Origin Domain Name and cname-api-key values since you'll need these later.

  2. Login to the Azure Portal.

  3. Create a new Azure CDN Profile.

  4. Create a new Azure CDN endpoint using the CDN Profile you just created. For the CDN endpoint settings, use the following values:

    Setting Value
    Name We recommend naming your CDN endpoint like your custom domain name, replacing dots with dashes. For example:
    Origin type Select Custom Origin
    Origin hostname Enter {yourTenant}.<CUSTOM_DOMAIN_ID>, making sure to replace <CUSTOM_DOMAIN_ID> with the custom domain ID from the Origin Domain Name you received from Auth0. If your tenants are not in the US region, use one of the following:
    • EU: {yourTenant}.<CUSTOM_DOMAIN_ID>
    • AU: {yourTenant}.<CUSTOM_DOMAIN_ID>
    • JP: {yourTenant}.<CUSTOM_DOMAIN_ID>
    Origin path Leave blank.
    Origin host header Use the name you provided for the Origin hostname.
    Protocol Disable HTTP so that only HTTPS is enabled.

  5. Add your custom domain to your Azure CDN endpoint.

  6. Configure HTTPS for your Azure CDN custom domain. This process requires you to verify ownership of the domain. Once done, it may take up to 6 hours to deploy the certificate to all of the CDN pop locations.

  7. Set up the configuration for the custom domain communication with Auth0 using the Azure CDN Rules engine. (To learn more, see Override HTTP behavior using the Azure CDN from Verizon Premium rules engine in Microsoft documentation.) Create a new Azure CDN Rule with the following settings:

    Setting Value
    Name/Description Auth0 Custom Domain
    Type of requests Select the Edge CName option, then select your custom domain name from the list.

  8. Add the following Features to your Azure CDN Rule: We recommend creating another Azure CDN Rule to deny the usage of the CNAME.

    Setting Value
    Bypass Cache Enabled
    Modify Client Request Header Select Override, enter cname-api-key for the name, and enter the CNAME API Key provided by Auth0 as the value.

  9. Once the Azure CDN Rule is approved, the status will change from Pending XML to Active XML. At this point, Azure CDN will be publishing the rules and certificates. When Azure finishes processing all changes, you can use your custom domain.

Learn more