Loadbalancing only /

Hi,
how can i loadbalance only / (/index.html or whatever)

i tried

location / {
    proxy_redirect off;
    proxy_max_temp_file_size 0;
    proxy_pass http://cluster2/$request_uri;
}

upstream cluster2 {
server www1.mydomain.de:80 weight=1;
server www2.mydomain.de:80 weight=50;
}

but this balances everything … bad…

I only want to balance things that i have defined like

location /bla
location /blubb/one
AND the Starpage
location /

I also tried
location ^/$
but with no Effekt…

How can i do that? Any Ideas?

Thanks!

Hello!

On Fri, Nov 06, 2009 at 04:14:18PM +0100, “Günther Haslbeck” wrote:

Hi,
how can i loadbalance only / (/index.html or whatever)

i tried

location / {
  • location / {
    
  • location = / {
    

See Module ngx_http_core_module for
details.

Maxim D.

http://wiki.nginx.org/NginxHttpCoreModule#location

location = / {

matches the query / only.

}

rr

— Original Message -----
From: ““Günther Haslbeck”” [email protected]
To: [email protected]
Sent: Friday, November 06, 2009 5:14 PM
Subject: Loadbalancing only /