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:
calvin_thefreak 2021-04-09 02:29:55 +02:00 committed by GitHub
parent 545b5828b5
commit d3a2d34229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;