Subdomain configuration problem

Hi,

I’m beginner in nginx, and i have searched google and mailing list but
no
luck.

my nginx.conf:

http{
server{
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass http://127.0.0.1:aaaa/;
}
}
server{
listen 80;
server_name subdomain.example.com;
location / {
proxy_pass http://127.0.0.1:bbbb/;
}
}
#rest of the default config like acces log, etc
}

Problem is after adding server block for subdomain, both request (
example.com, subdomain.example.com) loading only example.com in browser.
If i place subdomain server block listing as first one, both request (
example.com, subdomain.example.com) loading subdomain.example.com in
browser.

Please suggest me what could be the problem.

Thanks in Advance!!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs