nginx反向代理put delete 405(.net core webapi) 处理方式

发布后的web.config文件中新增以下内容:

            <modules runAllManagedModulesForAllRequests="true">
                <remove name="WebDAVModule" />
            </modules>

 

即为:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<location path="." inheritInChildApplications="false">
		<system.webServer>
			<modules runAllManagedModulesForAllRequests="true">
				<remove name="WebDAVModule" />
			</modules>
			<handlers>
				<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
			</handlers>
			<aspNetCore processPath="dotnet" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
				<environmentVariables>
					<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
				</environmentVariables>
			</aspNetCore>
		</system.webServer>
	</location>
</configuration>

  

posted @ 2023-03-03 16:00  mcluzhi  阅读(297)  评论(0编辑  收藏  举报