The sharepoint site doesn’t allow anonymous access and uses forms authentication, however I have custom page in “_layouts/” that anonymous users need to be able to access.
I thought it would be enough to add a <location></location> tag in the web.config with the correct path that allowed anonymous access (<allow users="*" />), however, this seems to have no effect.
I figured it out, the problem was a bit deeper. The page in question was set to use a masterpage dynamically which anonymous users did not have access. Otherwise the
<location></location>tag did work.