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.
This commit is contained in:
parent
545b5828b5
commit
d3a2d34229
1 changed files with 4 additions and 0 deletions
|
@ -20,6 +20,7 @@ http {
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|
||||||
upstream backend {
|
upstream backend {
|
||||||
|
#Add more Container IPs/Aliases here.
|
||||||
server __BACKEND__:6666;
|
server __BACKEND__:6666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +53,9 @@ http {
|
||||||
|
|
||||||
if ($request_uri ~* "/api/(.*)") {
|
if ($request_uri ~* "/api/(.*)") {
|
||||||
proxy_pass http://backend/$1;
|
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;
|
error_page 500 502 503 504 @badproxy;
|
||||||
|
|
Reference in a new issue