New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigureKestrel IPAddress.Loopback does not work #10873
Comments
Are you sure you started Kestrel and not IIS Express? IIS Express is the default profile when you hit F5 and it would require the name localhost in the url. FYI Http1AndHttp2 requires SSL/HTTPS. This should have thrown.
|
How to configure it to start kerstrel instead if IIS? |
https://i.stack.imgur.com/MUVJd.png |
Ah, VS Code... I don't know if that even supports IIS Express. |
Switch to use IPAddress.Any works. |
Pretty sure it's not IIS Express if we're on Linux ;). @khteh Can you clarify exactly what the actual behavior is? What URL is in the address bar (is it When you specify |
|
I'm not sure I understand you exactly here. So when specifying The |
|
What does Also, your
|
Same behavior as I get from launching the application from VSCode IDE by pressing 'F5':
Thanks for higlighting the |
Ok so Kestrel is indeed binding to the correct IP/port. Something in your middleware pipeline is yielding the 404. Otherwise you wouldn't see these log messages. I'd suggest debugging your middleware pipeline and seeing if there's somewhere that you could be 404ing. You're requesting |
I didn't request for index.html. I point the browser to |
There's a lot of middleware in your sample that could be interfering. I'd suggest trying to scale this back to a minimal set that reproduces the issue. That would help in further investigation. Turning your logging verbosity up in |
index.html coming from the swagger. but iam not sure about the error. it interesting with hosting environment |
I reverify this with ASP.Net Core 3.0 and configure Kestrel only in appsettings.json and I do not see the erroneous behaviour as in my original post. However, hitting |
I use ConfigureKestrel in order to enable protocol HTTP1.x and HTTP2. However, using IPAddress.Loopback does not work! The browser opens up 127.0.0.1/index.html and show "Page not found"! Modify the URL at the browser address bar to "localhost" works!
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Browser opens up 127.0.0.1/index.html works as expected.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Include the output of
dotnet --info
Visual Studio Code:
The text was updated successfully, but these errors were encountered: