Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have a ubuntu 10.04 with nginx /0.8.54 running as a load balance proxy named: www.local.com

I have two IIS backend servers which responds on Host header request web1.local.com web2.local.com

Problem: When i hit my nginx balancer on www.local.com my backend servers respond with the default server blank webpage (IIS default page) since they are waiting for a right host header (e.g. web1.local.com)

my nginx.conf

upstream backend { server web1.local.com:80; server web2.local.com:80; } server {

      listen 80;
            location / {
              proxy_pass  http://backend;
              proxy_set_header        X-Real-IP       $remote_addr;
              proxy_set_header        Host            $proxy_host;
            }
    }

any hint ?

share|improve this question
add comment

2 Answers

Would not proxy_set_header Host $host; solve your problem?

share|improve this answer
    
no the [ proxy_set_header Host $host; ] does not solve the problem and i dont know why... if i hardcode [ proxy_set_header Host web1.local.com; ] it works for one backend...?! inorder to work –  Elgreco08 Dec 30 '10 at 13:16
    
the funny thing is that the proxy_Set_header host $host does not help any other hint i should check? –  Elgreco08 Dec 30 '10 at 14:18
add comment
up vote 0 down vote accepted

So i solved the issue

The problem was first the missing proxy_set_header Host $host; and i was missing the right virtualhost ServerName www.domain.local name in the apache's conf file.

I was thinking that nginx is sending proxy headers internally using the server name listed in the upstream server list.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.