Work around CORS issues by running an Nginx reverse proxy that will cache requests to the source API.
- Docker
Check the serverblock inside default.conf
. At a minimum you'll need to change the destination address.
The config has a 10s cache expiry and some options to hide certain headers from the response.
See the Nginx documentation here.
docker build -t nginx-ccrp .
docker run -dit --name nginx-ccrp -p 8080:80 nginx-ccrp
Requests to http://localhost:8080/ should return your configured API.