So I basically followed this tutorial and set up a load balancer on my nginx server.

upstream backend  {
  server backend1.example.com;
  server backend2.example.com;

Now all the incoming request gets distributed amongst these servers.

My question is that how can I configure nginx to something like, any request that comes to 192.35.111.XX/?a=100 gets redirected to backend1.example.com/?a=100 (or backend2.example.com/?a=100)

Right not 192.35.111.XX/?a=100 redirects to backend1.example.com (or backend2.example.com)

How can I configure nginx to save parameters while load balancing ?


If you followed the steps of the tutorial, nginx does that by default and pass the original, untouched request URI to the backend.

How does the block containing the proxy_pass directive looks like? Is there anything which, according to its documentation, might overwrite the URI passed to the backend?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.