Next.js hosting configurations
Next.js and Sitefinity CMS configurations based on where your Sitefinity CMS project is hosted.
Sitefinity CMS hosted in Sitefinity cloud
Additional project setup steps for Sitefinity CMS hosted in Sitefinity cloud:
- 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.
- Set the
SF_LOCAL_VALIDATION_KEY
environment variable with the value of the secret copied in the previous step.
For more information, see Set up the project for local development (using Next.js Renderer).
Sitefinity CMS hosted 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:
- Set up a 64-bit process in the App Service platform configuration. To do this, perform the following:
- In the Azure portal, click Your service.
- Under Settings, click Configuration.
- Click General settings.
- In Platform dropdown box, select 64 Bit.
- Restart the app service.
- 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:
- In the Azure portal, click Your service.
- In the sidebar, under Development tools section, click Advanced Tools » Go.
- In the Kudu console, expand the Site extensions.
- Search for the Application Gateway Host Rewrite Module and follow the installation instructions.
- Restart the Kudu service.
Sitefinity CMS hosted 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:
- Download the NuGet package
Progress.Sitefinity.Cloud.AppGatewayHostRewriteModule
.
- Change the file extension from .nupkg to .zip and extract the files.
- In the extracted folder, navigate to the Content folder.
- 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.
- Open Internet Information Services (IIS) Manager.
- At the top, select your server and click Modules.
- Click Configure Native Modules » Register.
- Set the name to AppGatewayHostRewriteModule.
- In Path, navigate to the HostRewriteModule.dll, select it, and click OK.
- Ensure the checkbox next to AppGatewayHostRewriteModule is selected and click OK.
Next.js Renderer hosted 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:
- Install HttpPlatformHandler v1.2
- Add the following web.config file in the root of the web app:
- Be sure to replace the paths to node.exe and next if they are different
- Set the
SF_PROXY_ORIGINAL_HOST
to the actual domain of the Next.js Renderer app that will be used for hosting in IIS.
Next.js Renderer hosted 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'. 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.