diff --git a/default.conf b/default.conf index 81540a7..4aaad97 100644 --- a/default.conf +++ b/default.conf @@ -480,6 +480,50 @@ server { proxy_pass http://10.8.0.5:1492/webhook/create/; } + + location /squiz/bitrix/ { + 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,device,browser,os,devicetype,response-type 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,device,browser,os,devicetype,response-type always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + proxy_set_header Referer $host; + proxy_set_header Origin $http_origin; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Client-Port $remote_port; + proxy_set_header Origin $host; + + proxy_pass http://10.8.0.18:1492/bitrix/; + } + + + location /squiz/bitrix/oauth/ { + 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,device,browser,os,devicetype,response-type 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,device,browser,os,devicetype,response-type always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + proxy_set_header Referer $host; + proxy_set_header Origin $http_origin; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Client-Port $remote_port; + proxy_set_header Origin $host; + + proxy_pass http://10.8.0.18:1492/webhook/create/; + } + location /answer/v1.0.0/ {