The following fragment will pick one server at a time. Is there a way to hit them all at once?
upstream backend {
server 17.0.0.1:8000;
server 17.0.0.1:8001;
server 17.0.0.1:8002;
server 17.0.0.1:8003;
}
server {
location / {
proxy_pass http://backend;
}
}
Here is a solution using ngx_http_mirror_module (available since nginx 1.13.4):
server {
location / {
proxy_pass http://17.0.0.1:8000;
mirror /s1;
mirror /s2;
mirror /s3;
}
location /s1 { internal; proxy_pass http://17.0.0.1:8001$request_uri; }
location /s2 { internal; proxy_pass http://17.0.0.1:8002$request_uri; }
location /s3 { internal; proxy_pass http://17.0.0.1:8003$request_uri; }
}
nginx will:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With