Next.js hosting configurations

Host Sitefinity CMS in Sitefinity cloud

Additional project setup steps for Sitefinity CMS hosted in Sitefinity cloud:

  1. In Sitefinity Cloud, navigate to your dedicated Key Vault instance. For more information, see Azure Key Vault. Under Secrets, find the LocalValidationKey and copy the value of the secret.
  2. Set the SF_LOCAL_VALIDATION_KEY environment variable with the value of the secret copied in the previous step.

Host Sitefinity CMS in Azure

If your project is hosted on Azure App Services, you need to make some specific settings, so that your Sitefinity CMS can communicate with the Renderer application:

  1. Set up a 64-bit process in the App Service platform configuration. To do this, perform the following:
    1. In the Azure portal, click Your service.
    2. Under Settings, click Configuration.
    3. Click General settings.
    4. In Platform dropdown box, select 64 Bit.
    5. Restart the app service.
  2. Rewrite the X-Original-Host header sent from the Renderer to Host header. To do this, install an additional extension from the Kudu console in the following way:
    1. In the Azure portal, click Your service.
    2. In the sidebar, under Development tools section, click Advanced Tools » Go.
    3. In the Kudu console, expand the Site extensions.
    4. Search for the Application Gateway Host Rewrite Module and follow the installation instructions.
    5. Restart the Kudu service.

Host Sitefinity CMS on IIS

If your project is hosted on a local IIS, you need to make some specific settings, so that your Sitefinity CMS can communicate with the Renderer application:

  1. Download the NuGet package Progress.Sitefinity.Cloud.AppGatewayHostRewriteModule.
  2. Change the file extension from .nupkg to .zip and extract the files.
  3. In the extracted folder, navigate to the Content folder.
  4. Copy the HostRewriteModule.dll and paste in a dedicated folder.

NOTE: IIS's NETWORK SERVICE must have permissions to access the folder. The file must remain in this folder for as long as the extension is used. Deleting the file or its folder can cause issues.

  1. Open Internet Information Services (IIS) Manager.
  2. At the top, select your server and click Modules.
  3. Click Configure Native Modules » Register.
  4. Set the name to AppGatewayHostRewriteModule.
  5. In Path, navigate to the HostRewriteModule.dll, select it, and click OK.
  6. Ensure the checkbox next to AppGatewayHostRewriteModule is selected and click OK.

Host Next.js Renderer on IIS (using HttpPlatformHandler)

If you wish to host your Next.JS Renderer under IIS, you need to setup IIS to act as a proxy to your original application:

  1. Install HttpPlatformHandler v1.2
  2. Add the following web.config file in the root of the web app:
  3. Be sure to replace the paths to node.exe and next if they are different
  4. Set the SF_PROXY_ORIGINAL_HOST to the actual domain of the Next.js Renderer app that will be used for hosting in IIS.

Host Next.js Renderer on docker

When the renderer is hosted on docker the resolved host from the http request is in the form of 'localhost' or 'localhost:port'. As a consequence for every 21st request to a page you would recieve the license page since the domain of 'localhost' is not registered in the licsense file of the CMS. To adjust for this, make sure to pass to the X-ORIGINAL-HOST header, the proper value with the actual domain.

If using a single site only you can pass the value through the SF_PROXY_ORIGINAL_HOST environment variable.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?