[英]How to host Node JS app on IIS 10 with Windows Server 2019
[英]Windows server 2019 and IIS 10 GET,POST work fine but can't use PUT,DELETE from external
我尝试在 IIS 中安装 react(axios) 并使用 node.js 作为服务器 GET、POST 工作正常但是 PUT、DELETE(可以在内部使用)没有我在 Linux 服务器 node.js 中测试工作正常,我尝试解决一周,例如 ExtensionlessUrlHandler ,cors 等现在我在 IIS 中禁用请求过滤器仍然没有用。
Failed to load resource: net::ERR_CONNECTION_RESET
(我无法上传图片。)
web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
此错误可能是由 cookies 引起的,并且最常见于 chrome 用户。 您可以尝试以下步骤来解决您的问题。
Go 到 Chrome 设置 > 隐私和安全 > Cookies 和其他站点数据 > Cookie > 所有 cookie 和站点数据 > 删除域问题
或者你可以参考这个链接: Failed to load resource:.net::ERR_CONNECTION_RESET
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.