[英]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.