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.
Add the following rule to your
IISRewrite.configto exclude paths that should remain publicly accessible:
<rule name="Ignore" stopProcessing="true">
<match url="^(?:umbraco/api|umbraco/surface|umbraco/delivery)/" />
<action type="None" />
</rule>Note your allowed IP addresses as a pipe-separated regular expression. For example,
213.3.10.8and88.4.43.108becomes^(213\.3\.10\.8|88\.4\.43\.108)$.Add the following rule to your
IISRewrite.configto 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 you now go to /umbraco/ from a different IP-address the login screen will not be rendered.
Last updated
Was this helpful?