Copied to clipboard

Flag this post as spam?

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


  • Adrian 9 posts 109 karma points
    Oct 09, 2022 @ 11:54
    Adrian
    0

    ipSecurity in Umbraco 10

    Hi,

    I'm migrating a site from Umbraco v7 to v10 and have everything nicely in a solution now publishing to Azure App Services, but the one element I can't work out in the new world is how to replicate the previous web.config ip restrictions restrictions on the /umbraco path.

    Old web.config has the following:

    <location path="umbraco">
        <system.webServer>
            <security>
                <ipSecurity allowUnlisted="false">
                    <add ipAddress="xxx.xxx.xxx.xxx" allowed="true"/>
                    <add ipAddress="yyy.yyy.yyy.yyy" allowed="true"/>
                </ipSecurity>
            </security>
        </system.webServer>
    </location>
    

    Adding a web.config file to the solution manually just results in a 500 error "The requested page cannot be accessed because the related configuration data for the page is invalid." on .umbraco.

    Suspect this is probably more a kestrel / .net question, but could anyone point me in the right direction?

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Oct 10, 2022 @ 10:52
    Jeavon Leopold
    0

    If you are hosting on Windows Web Apps you can continue to configure IIS features via a web.config just like you have. You can add a web.config to the root of your solution in Visual Studio if you don't have one. If you are hosting on Linux you will need some Middleware, either your own or there are some NuGet packages (not tested myself) providing options such as https://github.com/msmolka/ZNetCS.AspNetCore.IPFiltering.

  • Adrian 9 posts 109 karma points
    Oct 17, 2022 @ 12:22
    Adrian
    0

    Thanks. I found the relevant link in the documentation which has solved the problem on v10. For anyone else looking, it's here: https://our.umbraco.com/Documentation/Reference/Routing/IISRewriteRules/

Please Sign in or register to post replies

Write your reply to:

Draft