From 271bb06ff2443f4bb0aa1240899607dfb68336b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sun, 4 Sep 2022 01:06:28 +0800 Subject: [PATCH] bypass host header --- conf/alchemy/ai.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/alchemy/ai.conf b/conf/alchemy/ai.conf index 24efd2f..3606e7d 100644 --- a/conf/alchemy/ai.conf +++ b/conf/alchemy/ai.conf @@ -34,6 +34,12 @@ server { } location /api/v1/ai/ { + proxy_set_header X-Real-IP $remote_addr; + # disable in local test env + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $remote_addr; + add_header Access-Control-Allow-Origin $http_origin always; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always; add_header Access-Control-Allow-Headers 'Authorization,HtyAdminToken,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;