Some time ago, when I wrote a web service using HttpListener in C#, it started running fine. After a while, the server restarted, and although the service started normally, it could no longer be accessed, and a 503 error appeared directly when browsing the web. But after changing the port number, the service is normal again, and after a while, a 503 error appears. After troubleshooting, use the netstat command in cmd to check whether the port number is occupied, and it seems that the port number is not occupied by any program. Then the problem was located in the error when accessing the URL, and after consulting some information, it was found that it was a problem with the URL cache.
Clean the URL cache The specific operation is as follows:
- Start running "cmd"
- Type "netsh" enter
- Enter "http" enter
- Enter "show urlacl" enter(At this time, you can already see some URL addresses of the port number you set, for example: http://+:9997/)
- Enter "delete urlacl http://+:9997/" (delete URL address cache)
Then restart my Http service and it will be back to normal immediately.
The interface is as follows
|