From 8504e4a77882176dfa68f9f29328763290bff6dd Mon Sep 17 00:00:00 2001 From: Mikhail Date: Tue, 12 Dec 2023 09:19:38 +0000 Subject: [PATCH] Update default.conf --- default.conf | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/default.conf b/default.conf index 8b86520..40b8018 100644 --- a/default.conf +++ b/default.conf @@ -104,12 +104,22 @@ server { add_header Access-Control-Allow-Credentials true always; add_header Access-Control-Allow-Headers content-type,authorization always; add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; - if ($host = squiz.pena.digital) { - proxy_pass http://10.6.0.23:1488/; - } - if ($host = hbpn.link) { - proxy_pass http://10.6.0.23:1490/; + proxy_pass http://10.6.0.23:1488/; + } + + location /answer { + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + return 200; } + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + proxy_pass http://10.6.0.23:1490/; } location /squizstorer/ {