Open grololo06 opened 1 year ago
location /api/object/ {
proxy_pass http://localhost:8000;
add_header 'Access-Control-Allow-Origin' '*' always;
}
location /api/vault/ {
proxy_pass http://localhost:8000;
add_header 'Access-Control-Allow-Origin' '*' always;
}
We have the problem with EcoTaxoGuide that the front-end app (using Angular) refuses to connect to the API because it does not provide a correct CORS (https://developer.mozilla.org/fr/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin).
E.g.: https://ecotaxa.obs-vlfr.fr/api/object/25557188
Hacked today a "solution" in nginx, but the proper fix should be in the back-end: https://fastapi.tiangolo.com/tutorial/cors/