Welcome! Log In Create A New Profile

Advanced

Load Balancing with rewrite

December 14, 2010 02:06AM
Hi!,
I'm doing a project to load balance our web services, but our web services are very strict in terms of received url.

nginx config

upstream mysite {
server testbox1:50011;
server testbox2:50012
}

server {
listen 8090;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
proxy_pass http://mysite;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

Example of request url for the Web services
http://testbox1:50011/test this is a test url for the web services just a simple test.
But when I tried using the nginx with loadbalancing
for nginx http://localhost:8090/test
in our web services received url: [b][i][u]http://mysite/test[/u][/i][/b] , our web services needs the actual server name and port to be successful with the testcase our web services should received [b][i][u]http://testbox1:50011/test[/u][/i][/b] or at the [b][i][u]http://testbox2:50012[/u][/i][/b]

Can anyone help me in rewriting the actual server name being used for the request in the round robin/load balancing mode.
Thank you very much.

Sincerely,
Gerald
Subject Author Posted

Load Balancing with rewrite

zerlite December 14, 2010 02:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready