Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will a serverside redirect (HttpResponse.Redirect) hit the load balancer again?

The Web server is behind a load balancer . I'am doing a HttpResponse.Redirect("anotherpage") . Will this redirect again go through the load balancer ? I'm confused as this is a serverside redirect , and not a redirect from the client .

I want to know this to determine if the redirected url is served by a different web server as determined by the load balancer .

like image 835
hari_sree Avatar asked Sep 13 '12 18:09

hari_sree


People also ask

Can a load balancer redirect to another load balancer?

If you're using an Application Load Balancer as part of your configuration, you can use it to redirect one domain to another: Open the Amazon Elastic Compute Cloud (Amazon EC2) console. On the navigation pane, choose Load Balancers under Load Balancing.

Do Loadbalancer redirect http to HTTPS?

Classic Load Balancers can't redirect HTTP traffic to HTTPS by default. Instead, configure your rewrite rules for the web servers instances behind the Classic Load Balancer. You must configure your rewrite rules to use the X-Forwarded-Proto header and redirect only HTTP clients.

How do I redirect traffic to HTTPS in the EC2 Elastic load balancer?

Select a load balancer, and then choose HTTP Listener. Under Rules, choose View/edit rules. Choose Edit Rule to modify the existing default rule to redirect all HTTP requests to HTTPS.

What is a listener load balancer?

A listener is a process that checks for connection requests. It is configured with a protocol and a port for front-end (client to load balancer) connections, and a protocol and a port for back-end (load balancer to back-end instance) connections. Elastic Load Balancing supports the following protocols: HTTP.


Video Answer


2 Answers

HttpResponse.Redirect is not actually a server-side redirect. Setting this in the Response stream actually sends a 302 "Moved Temporarily" response to the browser, instructing it to try another URL ("anotherroute").

like image 73
Peter J Avatar answered Oct 24 '22 15:10

Peter J


In case you do not want that behavior, you can use Server.Transfer(url); There is a good explanation about it here: http://www.developer.com/net/asp/article.php/3299641/ServerTransfer-Vs-ResponseRedirect.htm

like image 42
Ben Avatar answered Oct 24 '22 13:10

Ben