Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
924 views
in Technique[技术] by (71.8m points)

proxy - 504 (ECONNREFUSED) from proxied Angular HTTP request to IIS Express

Server: .Net Core 3.1 IIS Express 10

Client: Angular CLI 9.1.7

I have an Angular app whose HTTP calls to my locally running (IIS Express) .Net Core APIs are being proxied using the built in WebPack proxy. All proxied calls are returning with 504 and never reach the APIs. I have been unable to figure out what is causing the 504 response. These calls were working before the recent Windows updates; but I don't know if that is a coincidence and what the updates might have changed/broken.

Extra info:

  • Direct calls to the APIs (no proxy) from the Angular app, browser and Insomnia reach the API correctly.
  • I get the exact same 504 response even if IIS Express isn't running.
  • I created a new Angular app and made a proxied call to the APIs and got a 504 response.
  • I created a test Node API and sent a proxied call to it from the original Angular app and it worked (200).
  • I uninstalled IIS Express and reinstalled it, no change.
  • I checked the hosts file, which was in default state.
  • I flushed DNS, no change.
  • Despite the fact that the settings are correct and were working, I tried proxying to 127.0.0.1 instead of localhost. No change.
  • Additionally, I reverted the change and uncommented the entries in the hosts file to route localhost to 127.0.0.1 and flushed the DNS. No change.
  • I restarted Windows several times through the debug process; because Microsoft. No help.

Does anyone have any idea why I'm getting the 504 or suggestions of things I should try? Any help would be appreciated.

question from:https://stackoverflow.com/questions/65852380/504-econnrefused-from-proxied-angular-http-request-to-iis-express

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...