try to understand syntax of ngnix
This commit is contained in:
@@ -15,7 +15,7 @@ server {
|
|||||||
location ~* \.(opus|flac|ogg|mp3|wav|m4a|aac)$ {
|
location ~* \.(opus|flac|ogg|mp3|wav|m4a|aac)$ {
|
||||||
|
|
||||||
# --------- Preflight direkt per IF ---------
|
# --------- Preflight direkt per IF ---------
|
||||||
if ($request_method = "OPTIONS") {
|
if ($request_method = OPTIONS) {
|
||||||
add_header Access-Control-Allow-Origin "*";
|
add_header Access-Control-Allow-Origin "*";
|
||||||
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
|
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";
|
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) ---
|
# --- Key-Check (nur GET/HEAD) ---
|
||||||
if ($request_method != "OPTIONS") {
|
if ($request_method != OPTIONS) {
|
||||||
if ($http_x_api_key != "${MEDIA_API_KEY}") {
|
if ($http_x_api_key != "${MEDIA_API_KEY}") {
|
||||||
return 401;
|
return 401;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user