From d3a2d3422952ea43a6769fbc319f16b35814b840 Mon Sep 17 00:00:00 2001 From: calvin_thefreak <5560381+calvinthefreak@users.noreply.github.com> Date: Fri, 9 Apr 2021 02:29:55 +0200 Subject: [PATCH] Nginx added variable, to easier scale szuru. I made this changes with 4 Containers on my own instance and got up to 5K API requests/Sec on an Intel Celeron J4105. --- client/nginx.conf.docker | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/nginx.conf.docker b/client/nginx.conf.docker index 98c18b35..3a183f3f 100644 --- a/client/nginx.conf.docker +++ b/client/nginx.conf.docker @@ -20,6 +20,7 @@ http { keepalive_timeout 65; upstream backend { + #Add more Container IPs/Aliases here. server __BACKEND__:6666; } @@ -52,6 +53,9 @@ http { if ($request_uri ~* "/api/(.*)") { proxy_pass http://backend/$1; + #Display which Docker Container IP was used, this is helpfull, if using multiple servercontainers, so you can see which one served the api. + #this further increases the speed of the page. + add_header X-Backend-Server $upstream_addr; } error_page 500 502 503 504 @badproxy;