Setting runtime mode to production causes 404

I am trying to configure my site to run in production mode, so that every health check in the back office has a nice green tick. But as soon as I do this, all requests in my frontend suddenly return 404.

My appsettings.Production.json looks like this:

{
  "$schema": "./appsettings-schema.json",
  "ConnectionStrings": {
    "umbracoDbDSN_ProviderName": "System.Data.SqlClient"
  },
  "Umbraco": {
    "CMS": {
      "Runtime": {
        "Mode": "Production"
      },
      "ModelsBuilder": {
        "ModelsMode": "Nothing"
      },
      "Hosting": {
        "Debug": false
      },
      "Unattended": {
        "UpgradeUnattended": true
      },
      "WebRouting": {
        "UmbracoApplicationUrl": "https://mastrup.it/"
      },
      "RuntimeMinification": {
        "UseInMemoryCache": true,
        "CacheBuster": "AppDomain"
      },
      "Content": {
        "Notifications": {
          "Email": "[email protected]"
        }
      },
      "Global": {
        "VersionCheckPeriod": 0,
        "UseHttps": true
      }
    }
  }
}

If I remove the Runtime object everything looks fine.

My health checks look like this when running them without having set the runtime mode to Production:

And this is how it looks while running in Productionmode:

In the Security health check, the following checks suddenly fail after enabling Production mode:



Any idea why this is happening and how to fix this?

Runtime checks run at startup. So if any runtime check fails, Umbraco would fail to boot. Runtime checks are what they are: checks. They do not change anything in terms of behaviour, with one exception: it precompiles razor views. But I fail to see how that would affect the things you are experiences.

That last check error pinging the URL https://mastrup.it/ - "Not found"
seems a little odd.
As you’ve passed browsing on HTTPS scheme.. and the UmbracoApplicationUrl should be the url for this site to reach itself?

but on the razorCompileOnPublish.. if you’ve not set this then you’ll get 404’s

Runtime Modes | Umbraco CMS

Now I feel stupid… :roll_eyes:

Of course, I forgot to remove the following from my project file

<PropertyGroup>
    <RazorCompileOnBuild>false</RazorCompileOnBuild>
    <RazorCompileOnPublish>false</RazorCompileOnPublish>
</PropertyGroup>

Thanks, Mike!
Should’ve caught that myself – total brain freeze.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.