From a59b1cdc4ec9e6e4db4d4ba550a1de8e5b2c8929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E7=91=9E?= <807495056@qq.com> Date: Sat, 28 Mar 2020 17:15:51 +0800 Subject: [PATCH] cross-domain.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 跨域扩展添加 --- files/cross-domain.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 files/cross-domain.conf diff --git a/files/cross-domain.conf b/files/cross-domain.conf new file mode 100644 index 0000000..b0b024c --- /dev/null +++ b/files/cross-domain.conf @@ -0,0 +1,8 @@ +add_header Access-Control-Allow-Origin $http_origin always; +add_header Access-Control-Allow-Methods 'POST,GET,PUT,PATCH,OPTIONS,DELETE'; +add_header Access-Control-Max-Age '3600'; +add_header Access-Control-Allow-Headers $http_access_control_request_headers; +add_header Access-Control-Allow-Credentials 'true'; +if ($request_method = 'OPTIONS') { + return 200; +} \ No newline at end of file