【发布时间】:2020-12-08 23:03:50
【问题描述】:
我尝试在 IIS 中安装 react(axios) 并使用 node.js 作为服务器 GET、POST 工作正常但 PUT、DELETE(可以在内部使用)没有 我在 Linux 服务器上测试 node.js 工作正常,我尝试解决一周,例如 ExtensionlessUrlHandler ,cors 等。现在我在 IIS 中禁用请求过滤器仍然不起作用。
Failed to load resource: net::ERR_CONNECTION_RESET
(我无法上传图片。)
- 常见 HTTP 功能(已安装 4 个,共 6 个)
- 默认文档
- 目录浏览
- HTTP 错误
- 静态内容
- 运行状况和诊断
- HTTP 日志记录
- 性能
- 静态内容压缩
- 应用程序开发
- CGI
- ISAPI 扩展
- ISAPI 过滤器
- WebSocket 协议
- 管理工具
- IIS 管理控制台
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>
【问题讨论】:
标签: node.js reactjs windows iis