For the complete documentation index, see llms.txt. This page is also available as Markdown.

Lock Down Access to the Umbraco Folder (IIS)

Learn how to restrict access to the /umbraco/ folder by allowlisting IP addresses using IIS URL Rewrite rules.

This article explains how to lock down the /umbraco/ folder to specific IP addresses using IIS URL Rewrite. Use this approach to prevent the Umbraco backoffice from being accessible to everyone on the internet.

To follow these steps, you must have IIS URL Rewrite installed on your server.

Locking down /umbraco/ will also block API and Surface controllers and the Delivery API. The steps below exclude these paths before restricting the rest.

  1. Add the following rule to your IISRewrite.config to exclude paths that should remain publicly accessible:

<rule name="Ignore" stopProcessing="true">
    <match url="^(?:umbraco/api|umbraco/surface|umbraco/delivery)/" />
    <action type="None" />
</rule>

Some packages and add-ons expose paths under /umbraco/ that must also remain publicly accessible. For example, Umbraco Engage requires /umbraco/engage/* to be excluded.

Check the documentation for any installed packages to identify paths that need to be added to the exclusion rule.

  1. Note your allowed IP addresses as a pipe-separated regular expression. For example, 213.3.10.8 and 88.4.43.108 becomes ^(213\.3\.10\.8|88\.4\.43\.108)$.

  2. Add the following rule to your IISRewrite.config to block all other IP addresses:

<rule name="Allowed IPs" stopProcessing="true">
    <match url="^(?:umbraco)(?:/|$)" />
    <conditions>
        <add input="{REMOTE_ADDR}" negate="true" pattern="^(213\.3\.10\.8|88\.4\.43\.108)$" />
    </conditions>
    <action type="AbortRequest" />
</rule>

If your server is behind a load balancer, you should use {HTTP_X_FORWARDED_FOR} instead of {REMOTE_ADDR} as the input for the rule.

If you now go to /umbraco/ from a different IP-address the login screen will not be rendered.

Last updated

Was this helpful?