From ca2064f5aab3684784dd201ba0f620ecc89655a5 Mon Sep 17 00:00:00 2001 From: nannal Date: Thu, 8 Apr 2021 22:49:47 +0300 Subject: [PATCH] lazy 2 --- scripts/nginx.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/nginx.conf b/scripts/nginx.conf index 81eb6e3..b2438e1 100644 --- a/scripts/nginx.conf +++ b/scripts/nginx.conf @@ -39,6 +39,15 @@ http { root /usr/share/nginx/html; index index.html index.htm; add_header 'Access-Control-Allow-Origin' *; + if ($request_method = OPTIONS ) { + add_header "Access-Control-Allow-Origin" *; + add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD"; + add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept"; + return 200; + } + if ($request_method ~* "(GET|POST)") { + add_header "Access-Control-Allow-Origin" *; + } } #error_page 404 /404.html;