diff --git a/nginx/conf.d/default.conf.template b/nginx/conf.d/default.conf.template index 298f6af..969b78c 100644 --- a/nginx/conf.d/default.conf.template +++ b/nginx/conf.d/default.conf.template @@ -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";