Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
914 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...