From aed96c15a33519a2e8f4c0f0e5e6056d1b373e56 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Mon, 25 Oct 2021 16:32:52 +0330 Subject: [PATCH 1/2] Fix nginx config --- Deployment/nginx.conf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Deployment/nginx.conf b/Deployment/nginx.conf index 64ba68d80..2acfba89c 100644 --- a/Deployment/nginx.conf +++ b/Deployment/nginx.conf @@ -39,6 +39,10 @@ http { more_set_headers 'Access-Control-Allow-Headers: *'; more_set_headers 'Access-Control-Allow-Methods: POST, PUT, PATCH, GET, DELETE, OPTIONS, HEAD'; + if ($request_method = 'OPTIONS') { + return 204; + } + location /auth { proxy_pass http://docker-auth; } @@ -76,7 +80,7 @@ http { rewrite ^/sapi(.*)$ $1 break; } - location /api/v3/klines { + location /binance/api/v3/klines { proxy_set_header Host api.binance.com; proxy_pass https://api.binance.com; } From b88ce50f9d40779a7d20f6bc403408c6dc238076 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Mon, 25 Oct 2021 16:37:04 +0330 Subject: [PATCH 2/2] Fix nginx location rewrite --- Deployment/nginx.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Deployment/nginx.conf b/Deployment/nginx.conf index 2acfba89c..22c252869 100644 --- a/Deployment/nginx.conf +++ b/Deployment/nginx.conf @@ -80,9 +80,10 @@ http { rewrite ^/sapi(.*)$ $1 break; } - location /binance/api/v3/klines { + location /binance { proxy_set_header Host api.binance.com; proxy_pass https://api.binance.com; + rewrite ^/binance/(.*)$ /$1 break; } } }