From 95e20fa87d6f177deb069d5a84768a21b7c1fda9 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 7 Nov 2021 20:40:25 +0000 Subject: [PATCH] Simply nginx and caddy config. (#9) --- template/Caddyfile | 10 ---------- template/pipedproxy.conf | 2 -- template/ytproxy.conf | 5 ----- 3 files changed, 17 deletions(-) diff --git a/template/Caddyfile b/template/Caddyfile index df6f47b..79bad50 100644 --- a/template/Caddyfile +++ b/template/Caddyfile @@ -43,14 +43,7 @@ BACKEND_HOSTNAME { PROXY_HOSTNAME { @ytproxy path /videoplayback* /api/v4/* /api/manifest/* - @optionscall { - method OPTIONS - } - header { - Access-Control-Allow-Origin * - Access-Control-Allow-Headers * - # disable FLoC tracking Permissions-Policy interest-cohort=() @@ -73,12 +66,9 @@ PROXY_HOSTNAME { Cache-Control "public, max-age=604800" } - respond @optionscall 200 - reverse_proxy unix//var/run/ytproxy/http-proxy.sock { header_up -CF-Connecting-IP header_up -X-Forwarded-For - header_down -Access-Control-Allow-Origin header_down -etag header_down -alt-svc } diff --git a/template/pipedproxy.conf b/template/pipedproxy.conf index 9baba2e..4b04294 100644 --- a/template/pipedproxy.conf +++ b/template/pipedproxy.conf @@ -5,12 +5,10 @@ server { location ~ (/videoplayback|/api/v4/|/api/manifest/) { include snippets/ytproxy.conf; add_header Cache-Control private always; - proxy_hide_header Access-Control-Allow-Origin; } location / { include snippets/ytproxy.conf; add_header Cache-Control "public, max-age=604800"; - proxy_hide_header Access-Control-Allow-Origin; } } diff --git a/template/ytproxy.conf b/template/ytproxy.conf index 2062f64..a49eb47 100644 --- a/template/ytproxy.conf +++ b/template/ytproxy.conf @@ -1,8 +1,3 @@ -add_header Access-Control-Allow-Origin *; -add_header Access-Control-Allow-Headers *; -if ($request_method = OPTIONS ) { - return 200; -} proxy_buffering on; proxy_buffers 1024 16k; proxy_set_header X-Forwarded-For "";