Configured SignalR and WebSockets for improved reliability and large content handling. Added appsettings and web.config for production/IIS, including increased timeouts, message size limits, and security/compression settings. Added fallback to Long Polling if WebSockets fail.
96 lines
3.6 KiB
XML
96 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<configuration>
|
|
<location path="." inheritInChildApplications="false">
|
|
<system.webServer>
|
|
<handlers>
|
|
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
|
</handlers>
|
|
|
|
<aspNetCore processPath="dotnet"
|
|
arguments=".\Notemark.dll"
|
|
stdoutLogEnabled="false"
|
|
stdoutLogFile=".\logs\stdout"
|
|
hostingModel="inprocess"
|
|
requestTimeout="00:05:00">
|
|
<environmentVariables>
|
|
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
|
|
<environmentVariable name="ASPNETCORE_HTTP_TIMEOUT" value="300" />
|
|
</environmentVariables>
|
|
</aspNetCore>
|
|
|
|
<!-- WebSocket support for Blazor Server -->
|
|
<webSocket enabled="true"
|
|
receiveBufferLimit="4194304"
|
|
pingInterval="00:01:00" />
|
|
|
|
<!-- Configuration for larger files -->
|
|
<security>
|
|
<requestFiltering>
|
|
<requestLimits maxAllowedContentLength="104857600"
|
|
maxQueryString="8192"
|
|
maxUrl="8192" />
|
|
</requestFiltering>
|
|
</security>
|
|
|
|
<!-- HTTP protocol configuration -->
|
|
<httpProtocol>
|
|
<customHeaders>
|
|
<add name="Connection" value="Keep-Alive" />
|
|
<add name="X-Content-Type-Options" value="nosniff" />
|
|
<add name="X-Frame-Options" value="SAMEORIGIN" />
|
|
<add name="X-XSS-Protection" value="1; mode=block" />
|
|
</customHeaders>
|
|
</httpProtocol>
|
|
|
|
<!-- URL Rewrite for WebSockets and SPA routing -->
|
|
<rewrite>
|
|
<rules>
|
|
<rule name="WebSocket Support" enabled="true" stopProcessing="true">
|
|
<match url="(.*)" />
|
|
<conditions>
|
|
<add input="{HTTP_UPGRADE}" pattern="websocket" ignoreCase="true" />
|
|
<add input="{HTTP_CONNECTION}" pattern="upgrade" ignoreCase="true" />
|
|
</conditions>
|
|
<action type="None" />
|
|
</rule>
|
|
</rules>
|
|
</rewrite>
|
|
|
|
<!-- Compression for better performance -->
|
|
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
|
|
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
|
|
<dynamicTypes>
|
|
<add mimeType="text/*" enabled="true" />
|
|
<add mimeType="message/*" enabled="true" />
|
|
<add mimeType="application/javascript" enabled="true" />
|
|
<add mimeType="application/atom+xml" enabled="true" />
|
|
<add mimeType="application/xaml+xml" enabled="true" />
|
|
<add encoding="*" enabled="true" />
|
|
</dynamicTypes>
|
|
<staticTypes>
|
|
<add mimeType="text/*" enabled="true" />
|
|
<add mimeType="message/*" enabled="true" />
|
|
<add mimeType="application/javascript" enabled="true" />
|
|
<add mimeType="application/atom+xml" enabled="true" />
|
|
<add mimeType="application/xaml+xml" enabled="true" />
|
|
<add encoding="*" enabled="true" />
|
|
</staticTypes>
|
|
</httpCompression>
|
|
|
|
<!-- Caching for static files -->
|
|
<staticContent>
|
|
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
|
|
</staticContent>
|
|
|
|
</system.webServer>
|
|
</location>
|
|
|
|
<!-- Classic ASP.NET settings for compatibility -->
|
|
<system.web>
|
|
<httpRuntime maxRequestLength="102400"
|
|
executionTimeout="300"
|
|
enableVersionHeader="false" />
|
|
<compilation debug="false" />
|
|
</system.web>
|
|
|
|
</configuration> |