簡體   English   中英

Windows 服務器 2019 和 IIS 10 GET、POST 工作正常但不能從外部使用 PUT、DELETE

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

(我無法上傳圖片。)

  • 常見 HTTP 功能(已安裝 4 個,共 6 個)
    • 默認文件
    • 目錄瀏覽
    • HTTP 錯誤
    • Static 內容
  • 健康與診斷
    • HTTP 記錄
  • 表現
    • Static 內容壓縮
  • 應用開發
    • 電腦影像
    • 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>

此錯誤可能是由 cookies 引起的,並且最常見於 chrome 用戶。 您可以嘗試以下步驟來解決您的問題。

Go 到 Chrome 設置 > 隱私和安全 > Cookies 和其他站點數據 > Cookie > 所有 cookie 和站點數據 > 刪除域問題

或者你可以參考這個鏈接: Failed to load resource:.net::ERR_CONNECTION_RESET

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM