try to understand syntax of ngnix

This commit is contained in:
2025-07-17 13:51:43 +02:00
parent 35060b11df
commit e3eb6db1f4

View File

@@ -15,7 +15,7 @@ server {
location ~* \.(opus|flac|ogg|mp3|wav|m4a|aac)$ {
# --------- Preflight direkt per IF ---------
if ($request_method = "OPTIONS") {
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,Keep-Alive,User-Agent,Cache-Control,Content-Type";
@@ -25,7 +25,7 @@ server {
}
# --- Key-Check (nur GET/HEAD) ---
if ($request_method != "OPTIONS") {
if ($request_method != OPTIONS) {
if ($http_x_api_key != "${MEDIA_API_KEY}") {
return 401;
}