Proper way to get uri of backend server

Hi everybody,

I want return a page with simply the uri of backend server. For
example, I have two servers (, and
when a client ask to /geturi/?TEST=hello, I want to hash ‘hello’ for
retrieving a server hostname.

This is my solution :

on loadbalancer

upstream backend_ap {
hash $arg_TEST;

location /geturi {
default_type text/html;
proxy_pass http://backend_ap;

on backend server

location / {
root html;
index /index.html;

   allow   X.X.0.0/16;
   deny    all;


cat /usr/local/nginx/html/index.html

Do you have a faster way ?

Thanks in advance

Vincent Chavelle

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs