Hi @artvandelay440 What exactly is your problem?
My web.config looks like this. I am using UniversalDashboard 2.9.0 and powershell 7. I am logging to the logs
subfolder of my web.config root directory (stdoutLogFile
). You can remove the complete rewrite
(including <rules>
) block if you do not like the http to https redirect and you can remove (or set to false) forwardWindowsAuthToken="true"
and requestTimeout="09:00:00"
.
The dashboard.ps1
file should also be located in the web.config root directory of your website.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<security>
<!-- <requestFiltering removeServerHeader ="true" /> -->
</security>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\PowerShell\7\pwsh.exe" arguments=".\dashboard.ps1" stdoutLogEnabled="true" stdoutLogFile=".\logs\\stdout" forwardWindowsAuthToken="true" requestTimeout="09:00:00" />
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
<rewrite>
<rules>
<rule name="Rewrite_HTTP_HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
A default web.config should look similar to this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<security>
<!-- <requestFiltering removeServerHeader ="true" /> -->
</security>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" arguments=".\dashboard.ps1" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>