C# Swagger问题记录:
1、使用nginx代理时无法访问Swagger
修改文件Web.config;在configuration节点下添加节点(暂未明白该配置项的作用)
<add key="aspnet:UseHostHeaderForRequestUrl" value="true"/>
2、使用nginx代理后出现 Can't read from server. It may not have the appropriate access-control-origin settings
修改文件Web.config;在system.webServer节点下添加节点
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Headers" value="Content-Type"/>
<add name="Access-Control-Allow-Methods" value="POST, GET, PUT, DELETE, OPTIONS"/>
</customHeaders>
</httpProtocol>