Skip to content

setting <Location Path="xxxx"> in web.config results in 404 from IISExpress #54523

Open
@mdzieg

Description

@mdzieg

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I am unable to exclude windows authentication for a path (healthcheck) for my aspnet app.

In launchsettings we have enabled windows authentication:

"iisSettings": {
    "windowsAuthentication": true,
    "anonymousAuthentication": false,
	  "iisExpress": {
      "applicationUrl": "http://localhost:54594",
      "sslPort": 44319
    }

Then, I added an element in webconfig to enable anonymous access:

	<location path="health">
		<system.webServer>
			<security>
				<authentication>
					<anonymousAuthentication enabled="true" />
					<windowsAuthentication enabled="false" />
				</authentication>
			</security>
		</system.webServer>
	</location>

With this in place I have 404 error when accessing the path, the error comes from IIS. As if all handlers were wiped out.

curl https://localhost:44319/health
curl : HTTP Error 404.0 - Not Found

Expected Behavior

I should see healthcheck page not 404 error from IISExpress.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8.0.101

Anything else?

IDE: Rider

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-iisIncludes: IIS, ANCM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions