How to allow CORS (cross-origin/domain) API calls with nginx.
For nginx see the following:
The code as per nginx docs, can be placed under: http, server or location, so you can decide how fine grane access you wish to allow.
NOTE: Before you copy and paste, you can just read what CORS is. This is a good source: Mozilla docs CORS.