ASPNetCore MVC routing allows the server to handle a specific route

This is a fork of the previous, unresolved question

On the remote web host, I am the user. This is a public hosting environment. The host is using Plesk and I am trying to fix my AspNetCore application to allow Let's Encrypt installation and encryption.

I'm pretty sure the AspNetCore app is interfering with the Let's Encrypt installation and auto update, as I can create a blank site and install "Allow Encrypted Certificates" without any problem, and when I create a new site using the AspNetCore "Quick Launch" app, the installation and update fails are performed.

I suspect the host may be configured to route all directory requests to ./well-known/

a virtual directory that I do not have access to (waiting for a response from the host).

All the solutions I was directed to or provided some kind of administrative access to the server, which is not a solution in my case. I am a user.

One solution was to set up a route and the application fulfilled the requested challenge key. Since I don't have access to the (possibly) aliased directory, I can't MVC handle the route this way.

The only thing I can think of is setting up the MVC routes somehow, so that when it receives a request for /.well-known/

, it will pass the request to the server. A literal pass along the route to ensure that MVC routing doesn't get in the way, does nothing but stop the request and only let the server process the request. Is it possible?

+2


source to share


1 answer


The host found a solution. It was an IIS configuration setting.

In the directory ./.well-known/

create a file namedweb.config

web.config



<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <remove name="aspNetCore" />
        </handlers>
    </system.webServer>
</configuration>

      

I'm not sure what it does, but it looks like it excludes aspNetCore from handling any calls to that directory.

+2


source







All Articles