Load Balance Advice

All,

I have been using lighttpd for a long time now, sitting in front of a
series of back end servers. I have been told to check out nginx because
lighttpd is now starting to consume near on 100% of the CPU.

I have setup nginx as a frontend load balancer and so far good, except
got a wee problem with the content coming back. nginx seems to be
rewriting all the URL hosts inside the returned content, to “myproject”.

I do not wish nginx to fiddle with the content at all. No need to.
Just leave it please! :wink:

I have pasted the “standard” example here


upstream myproject {
server 10.0.0.150:80 weight=3;
server 10.0.0.153:80;
}

server {
listen 80;
server_name localhost;
location / {
proxy_redirect off;
}
}


What have i missed?

thanks again for any input

a


Alan W.

Try our free registrationless email/sms reminder
http://yourli.st/

b: http://alan.blog-city.com/

On Mon, Jun 23, 2008 at 10:36:24PM +0100, Alan W. wrote:

server_name localhost;
location / {
proxy_redirect off;
}
}


What have i missed?

nginx does not change HTML.
Probably you see redirects from backend. nginx can rewrite them, but
you disable it: “proxy_redirect off”.
Could you write example, what you see and what proxy_pass directive
do you use ?

Igor S. wrote:

On Mon, Jun 23, 2008 at 10:36:24PM +0100, Alan W. wrote:

What have i missed?

nginx does not change HTML.
Probably you see redirects from backend. nginx can rewrite them, but
you disable it: “proxy_redirect off”.
Could you write example, what you see and what proxy_pass directive
do you use ?

I had missed this direction:

proxy_set_header Host $host;

irrespective of what HTTP version i was coming in on, it was dropping
the “host:” directive. As soon as i put that in, burst into life.

thanks


Alan W.

Try our free registrationless email/sms reminder
http://yourli.st/

b: http://alan.blog-city.com/

Igor S. wrote:

then “Host” will be “myproject”.

Thanks Igor. So i take it then my proxy_set_header directive overwrites
the “Host” part. The backends won’t be presented with 2 “Host” fields?


Alan W.

Try our free registrationless email/sms reminder
http://yourli.st/

b: http://alan.blog-city.com/

On Tue, Jun 24, 2008 at 09:16:18AM +0100, Alan W. wrote:

  proxy_pass  http://myproject;

then “Host” will be “myproject”.

Thanks Igor. So i take it then my proxy_set_header directive overwrites
the “Host” part. The backends won’t be presented with 2 “Host” fields?

Any proxy_set_header always overrides header.

On Tue, Jun 24, 2008 at 08:07:34AM +0100, Alan W. wrote:

I had missed this direction:

proxy_set_header Host $host;

irrespective of what HTTP version i was coming in on, it was dropping
the “host:” directive. As soon as i put that in, burst into life.

By default “Host” is set to a host in proxy_pass directive, i.e., if

   proxy_pass  http://myproject;

then “Host” will be “myproject”.