[HELP] web.config for IIS

i am having great deal of problem hosting cockpit.
i followed This Config, however it just solves the problem of access and login in to the dashboard. preety much everything else is not working. any kind of help will be helpful. Thanks.

Dear @Cryptospy ,

My educated guess:
Are you seeing blank screens everywhere you click (after login)?. Since I am also on IIS, I had to dig deep for this issue. Using the devtools (press F12) and going to the network tab (refresh the page first) I was able to spot the problem (HTTP requests with errors).

Solution:
Cockpit relies for some reason on .tag file/web extention, which is not supported by IIS out of the box. Therefore I had to manually add .tag file extension as mime-types (mimeType html/text).
Please read below for more information about adding a mime-type:

Hopefully this helps!

1 Like

Thank you so much, it worked For those having similar issues this is what i did:
create a web.config file in the root cockpit directory, and put the following code:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>



  <system.webServer>
   <staticContent>
        
         <mimeMap fileExtension=".tag" mimeType="text/plain" />
      </staticContent>

  
  <rewrite>
  <rules>
    <rule name="Imported Rule 1" stopProcessing="true">
      <match url="^.*/?\.git+" ignoreCase="false" />
      <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
    </rule>
    <rule name="Imported Rule 2" stopProcessing="true">
      <match url=".*" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php" />
    </rule>
  </rules>
</rewrite>
</system.webServer>
</configuration>