try to make it work 1

This commit is contained in:
2025-07-17 13:39:17 +02:00
parent 7b65409c9b
commit 786ba2a3b4

View File

@@ -1,11 +1,6 @@
# --------------------------- ENV-Key übernehmen ---------------------------
# envsubst ersetzt ${MEDIA_API_KEY} durch den Wert aus docker-compose.yml
# --------- Preflight-Erkennung per map ---------
map $request_method $cors_preflight {
"OPTIONS" 1;
default 0;
}
server {
listen 80;
@@ -14,8 +9,8 @@ server {
root /usr/share/nginx/html;
index index.html;
# ---------- Preflight (OPTIONS) ----------
if ($cors_preflight = 1) {
# --------- Preflight direkt per IF ---------
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Headers "Content-Type, X-API-Key";