Allowing CORS from Controller :8087 to API to know when first repair has completed.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2026-02-27 19:56:18 -07:00
parent ebac4fdfa2
commit bfaf1514da
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
2 changed files with 18 additions and 1 deletions

View file

@ -45,6 +45,23 @@ http {
ssl_certificate /etc/nginx/cert.crt;
ssl_certificate_key /etc/nginx/cert.key;
# CORS headers for Controller direct access (http://host:8087 -> https://host/api)
# Added at server level so they apply to error pages (502, etc.)
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept' always;
# Override http-level error_page to use named location with CORS
error_page 502 503 504 @error_with_cors;
location @error_with_cors {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept' always;
root /var/www;
try_files /50x.html =502;
}
include /etc/nginx/conf.d/*;
}