mirror of
https://github.com/ridercz/AutoACME.git
synced 2026-04-25 07:05:55 +03:00
[GH-ISSUE #7] Error 404 when trying to open the acme challenge url II #9
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AutoACME#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @petrnejedly on GitHub (Jan 17, 2018).
Original GitHub issue: https://github.com/ridercz/AutoACME/issues/7
Hi,
I have a Windows 2016 server running dozens of websites, many of them still using the .NET 2.0 framework. In some cases, the server side Url Redirecting (
http(s)://www.site.eu/.well-known/acme-challenge/something==>http://localhost/AutoACME/something) works just fine. But in other cases, the attempt to call an url likehttp(s)://www.site.eu/.well-known/acme-challenge/somethingends up with the error 404 Not Found. I was trying to investigate why and it looks like this part of Web.Config file causes the problem:I need this to be set to
trueso url adresses without any extension (e.g.http(s)://www.site.eu/product-name) can be handled by the .Net Framework (2.0). Internally, these websites useGlobal.asaxandApplication_BeginRequestto handle "non-existing" urls.Is there anything I can do to keep using
<modules runAllManagedModulesForAllRequests="true">and still be able to use the server side Url Redirecting and AutoACME?Regards, Petr
@ridercz commented on GitHub (Jan 19, 2018):
That's the cause of the problem. Applications aren't supposed to do that in
BeginRequestphase. It's too early and causes various problems including inability to do proper authentication, caching etc. And URL rewriting, which is used by AutoACME.You have to change your application. The simple way is to modify the code in the
BeginRequestevent handler to ignore any request which starts with./well-known/. The right way is to move the code to some more fitting event, likePostMapRequestHandlerorPreRequestHandlerExecute.