This one was unexpected. My team has currently been having a problem calling a remote service from our Angular application.

We work in a microservice environment, so our UI microservice includes an Angular app that runs on top of NGINX. NGINX is used as a reverse proxy to call remote services--some my team owns and some we don't.

A big reason for using NGINX as a reverse proxy is to avoid CORS issues. NGINX is a server, and server to server communication is not subject to the same limitations as browser to server communication.

But, alas, we were getting a CORS error when trying to call a remote service that we didn't own.

After some experimentation, we found an answer, and maybe that will help others. We juste had top add this:

view plain print about
1proxy_set_header Origin '';

The remote server was set up using Java and SpringBoot. As best we understand, when that code was set up for CORS, it also expected the origin header to exist; even for server to server communication.

This config problem solved our issue, and we moved onto the next problem.