Speed up widget development with Sitefinity MCP server. Learn more...

Automatic detection of externally rendered pages

Enable automatic detection of externally rendered pages

To enable automatic detection, perform the following:

  1. Update your proxy file using the sample below.

    Depending on your project structure, this file may be named proxy.ts or middleware.ts.

  2. In your environment configuration, set the following variable:
    SF_PROXY_BY_DEFAULT="true"
  3. Restart the Next.js renderer application.

When SF_PROXY_BY_DEFAULT is set to true, the proxy switches to proxy-by-default mode. In this mode, requests are sent to Sitefinity unless the middleware detects that the requested page is externally rendered and should be served through Next.js.

When to use fallback path settings

Automatic detection does not replace all proxy-related configuration.

Use the following settings when you need explicit routing behavior:

  1. Use SF_WHITELISTED_PATHS for legacy MVC pages, WebForms pages, or custom paths that must always be proxied to Sitefinity.
  2. Use SF_IS_HOME_PAGE_LEGACY="true" when the site home page (/) is still implemented as a legacy page and must be proxied to Sitefinity.
  3. Use SF_WHITELISTED_WEBSERVICES for additional Sitefinity web service endpoints that must pass through the proxy.

If your project still depends on explicit frontend path routing, SF_WHITELISTED_NEXTJS_PATHS remains a valid fallback option.

Proxy sample

NEW TO SITEFINITY?

Want to learn more?

Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.

Get started with Integration Hub | Sitefinity Cloud

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 your 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 ASP.NET Core and take advantage of its decoupled architecture and modern development model.

Was this article helpful?