From bfaf1514daa7c1f7a05ab59382a6d8002d8a7f4d Mon Sep 17 00:00:00 2001 From: Roland Date: Fri, 27 Feb 2026 19:56:18 -0700 Subject: [PATCH] Allowing CORS from Controller :8087 to API to know when first repair has completed. --- etc/raspberrypios/nginx.conf | 17 +++++++++++++++++ wrolpi/version.txt | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/etc/raspberrypios/nginx.conf b/etc/raspberrypios/nginx.conf index 4d575d68..df0c1f61 100644 --- a/etc/raspberrypios/nginx.conf +++ b/etc/raspberrypios/nginx.conf @@ -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/*; } diff --git a/wrolpi/version.txt b/wrolpi/version.txt index ce9361f6..715fd561 100644 --- a/wrolpi/version.txt +++ b/wrolpi/version.txt @@ -1 +1 @@ -0.17.4-beta +0.17.5-beta