Link to home
Create AccountLog in
Avatar of virtualjim
virtualjimFlag for Slovenia

asked on

nginx proxy load balance

i have a ubuntu 10.04 with nginx /0.8.54 running as a load balance proxy

I have two IIS backend servers which responds on Host header request

now when i hit my nginx balancer on my backend servers dont (they respond with the defalt IP webpage {empy} )respond since they are waiting for a right host header (e.g.

my nginx.conf
upstream backend {
        server {
          listen 80;
                location / {
                  proxy_pass  http://backend;
                  proxy_set_header        X-Real-IP       $remote_addr;
                  proxy_set_header        Host            $proxy_host;

any hint ?
Avatar of ToxicPig
Flag of United States of America image

As the load balancer is simply forwarding a request for, then your backend servers need to have VirtualHosts set up to respond to that address.  Accomplish this via a ServerAlias directive (or even set the ServerName itself) within your Apache config.
Oh, IIS, sorry.  On your Web Site Properties dialog, under Web Site, hit the Advanced dialog and add Host Headers (aliases) that the site should respond to.  Put here.
Avatar of virtualjim


my IIS web servers are responding isung web1 and web2

The thing is that ngix x as a proxy load balancer does not send http post headers right
Avatar of ToxicPig
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
What header is it sending?

do you know how nginx works?

proxy_set_header        Host            $_host;

Open in new window

Should work..but it does not

Right, which is why I would like to know EXACTLY what it IS sending.  Trace a header please.

So from my local pc if i hit it responds
if i hit from nginx using lynx it responds

but when i try to hit from my pc or from nginx i always get the default webpage

how can i trace a header ?