I recently deployed my first Flask app using IIS on Windows Server 2019 with wfastcgi.
I'm able to see the website on http:myServerIP:88/, log-in and everything else works. I'm also able to see some JSON data output when accessing some GET routes from remote systems.
However, whenever I try to run Invoke-RestMethod
from remote computer, which collects some information and calls the URL of the route of my website to update the info to MongoDB on server, it shows the error 500:
Invoke-RestMethod : 500 Internal Server Error Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
At C:\Users\wk14\Desktop\update2DB.ps1:401 char:8
- $res = Invoke-RestMethod -Method 'Put' -Uri $url -Body (ConvertTo-Jso ...
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
I've tested out the PUT route of my app by hosting it on Flask's dev server, and have the remote computer save its JSON data to a text file, then call the Invoke-RestMethod
on my host, and it was able to update the data to MongoDB without issues.
But after deploying the Flask app on IIS, the PUT route just stopped working with the error 500 on remote system.
I've tried looking around in the IIS manager, but still couldn't figure out what the issue is.
Could someone please give me some guidance? Thank you!!
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
My website is on http:/(myServerIP):88/ , would this security protocol matter? – wk14 Mar 11 '21 at 21:26