# Subdomain configuration problem

**URL:** <https://www.ruby-forum.com/t/subdomain-configuration-problem/242712>\
**Category:** NGINX\
**Created:** [July 19, 2015, 6:03pm UTC](https://www.ruby-forum.com/t/subdomain-configuration-problem/242712 "2015-07-19T18:03:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [July 19, 2015, 6:03pm UTC](https://www.ruby-forum.com/t/subdomain-configuration-problem/242712/1 "2015-07-19T18:03:08Z")

</div>

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](http://example.com) [www.example.com](http://www.example.com);  
location / {  
proxy\_pass [http://127.0.0.1](http://127.0.0.1):aaaa/;  
}  
}  
server{  
listen 80;  
server\_name [subdomain.example.com](http://subdomain.example.com);  
location / {  
proxy\_pass [http://127.0.0.1](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](http://example.com), [subdomain.example.com](http://subdomain.example.com)) loading only [example.com](http://example.com) in browser.  
If i place subdomain server block listing as first one, both request (  
[example.com](http://example.com), [subdomain.example.com](http://subdomain.example.com)) loading [subdomain.example.com](http://subdomain.example.com) in  
browser.

Please suggest me what could be the problem.

Thanks in Advance!!
