diff --git a/default.conf b/default.conf index f1a5745..aff37f7 100644 --- a/default.conf +++ b/default.conf @@ -284,6 +284,19 @@ server { proxy_cache off; proxy_pass https://storage.yandexcloud.net; } + + upstream verificationv0 { + server 10.8.0.6:7035; + } + + upstream verificationv1.0.0 { + server 10.8.0.6:7036; + } + + map $uri $service { + ~^/([^/]+).*$ $1; + } + location /verification/ { if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin $http_origin always; @@ -296,6 +309,7 @@ server { add_header Access-Control-Allow-Credentials true always; add_header Access-Control-Allow-Headers content-type,authorization,response-type always; add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + add_header Service $service; proxy_set_header Referer $host; proxy_set_header Origin $http_origin; proxy_set_header Connection ''; @@ -303,9 +317,7 @@ server { chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; - if ($http_apiversion = "v1.0.0") { - proxy_pass http://10.8.0.6:7036/; - } + proxy_pass http://10.8.0.6:7035/; }