0

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 ?

2 Answers 2

1

Would not proxy_set_header Host $host; solve your problem?

2
  • 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 Commented Dec 30, 2010 at 13:16
  • the funny thing is that the proxy_Set_header host $host does not help any other hint i should check? Commented Dec 30, 2010 at 14:18
0

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.