again new try
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# --------------------------- ENV-Key übernehmen ---------------------------
|
# --------------------------- ENV-Key übernehmen ---------------------------
|
||||||
# envsubst ersetzt ${MEDIA_API_KEY} durch den Wert aus docker-compose.yml
|
# envsubst ersetzt ${MEDIA_API_KEY} durch den Wert aus docker-compose.yml
|
||||||
|
|
||||||
|
# --------- Preflight-Erkennung per map ---------
|
||||||
map $request_method $cors_preflight {
|
map $request_method $cors_preflight {
|
||||||
"OPTIONS" 1;
|
"OPTIONS" 1;
|
||||||
default 0;
|
default 0;
|
||||||
@@ -27,7 +28,9 @@ server {
|
|||||||
|
|
||||||
# --- Key-Check (nur GET/HEAD) ---
|
# --- Key-Check (nur GET/HEAD) ---
|
||||||
if ($request_method != "OPTIONS") {
|
if ($request_method != "OPTIONS") {
|
||||||
if ($http_x_api_key != "${MEDIA_API_KEY}") { return 401; }
|
if ($http_x_api_key != "${MEDIA_API_KEY}") {
|
||||||
|
return 401;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- CORS & Cache ---
|
# --- CORS & Cache ---
|
||||||
|
Reference in New Issue
Block a user