I have the following architecture:
- A backend which offers services via REST api. This backend uses an embedded Tomcat server started on http://localhost:8080.
- A frontend in Angular 2 with a static HTTP server (lite-server) on http://localhost:8000. The frontend sent requests to backend via "@angular/http".
The frontend is published on Internet to be accessible for everyone. I would like to protect the backend from CORS (only my frontend can do request on the backend).
What should be the value send by backend for 'Access-Control-Allow-Origin' in HTTP header ? I guess the request sent by frontend has the origin equals to IP address of the final user ? So, I should put a wildcard "*" as 'Access-Control-Allow-Origin' ? => no CORS security
Is my understanding is correct ? Is my architecture is bad ? What is the solution to this problem ?