Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Euan Rae 105 posts 135 karma points
    Jan 16, 2020 @ 16:03
    Euan Rae
    0

    Umbraco 8 Load Balancing - Disabling CMS access on Slave Servers

    Hi,

    Situation; we have a multi-server environment in which we want to make the Umbraco back office inaccessible on the Front End servers.

    We are achieving this by deploying a package on the front end servers that doesn't have the 'Umbraco' folder, so going to https://www.[publicdomain].com/umbraco just returns a 404. This is a bit clunky but it works.

    The other option is to set rules through the load balancer ( or redirect ruls), however this has some complexities to do with Umbraco routing, e.g. Ajax requests to surface controllers, e.g. /umbraco/Surface/....., so you can create rules, but you need exclusions as well

    Is there a way you can disable/hide Umbraco back office access through config?

    If a server is set to be a slave it seems that disabling Umbraco on these nodes is the logic outcome, but this doesn't appear to be case.

    Any help is greatly appreciated.

    Thanks, Euan

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jan 17, 2020 @ 11:43
  • Euan Rae 105 posts 135 karma points
    Jan 18, 2020 @ 10:07
    Euan Rae
    0

    Thanks Ismail; I've done similar things in the past and this looks to do the job; I was just hoping there was simpler way to do it in code.

    I think I'll put in a feature request and see how much uptake it gets.

    Euan

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Jul 01, 2020 @ 15:18
    Jeavon Leopold
    0

    Yes, a rewrite rule is the main way to do it, slightly updated from that old post. Make sure you update your own URL for accessing the Umbraco UI in the 1st condition

      <rules>
        <!-- Restrict access to Umbraco -->
        <rule name="Restrict access" stopProcessing="true">
          <match url="umbraco$|umbraco/(?!surface\/)(?!api\/)(?!webservices\/)" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{HTTP_HOST}" pattern="(([^.]+)\.)?back-office-url\.azurewebsites\.net" negate="true" />
            <add input="{HTTP_HOST}" pattern="(([^.]+)\.)?localhost" negate="true" />
          </conditions>
          <action type="CustomResponse" statusCode="404" />
        </rule>
    
Please Sign in or register to post replies

Write your reply to:

Draft